Index: kernel/generic/src/ipc/sysipc.c
===================================================================
--- kernel/generic/src/ipc/sysipc.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ kernel/generic/src/ipc/sysipc.c	(revision a53ed3a8097360ccf174e8d94fb407db919eb66a)
@@ -158,7 +158,7 @@
  *
  */
-int answer_preprocess(call_t *answer, ipc_data_t *olddata)
-{
-	int rc = EOK;
+errno_t answer_preprocess(call_t *answer, ipc_data_t *olddata)
+{
+	errno_t rc = EOK;
 
 	spinlock_lock(&answer->forget_lock);
@@ -194,5 +194,5 @@
 	spinlock_unlock(&answer->forget_lock);
 
-	if ((int) IPC_GET_RETVAL(answer->data) == EHANGUP) {
+	if ((errno_t) IPC_GET_RETVAL(answer->data) == EHANGUP) {
 		phone_t *phone = answer->caller_phone;
 		mutex_lock(&phone->lock);
@@ -222,5 +222,5 @@
  *
  */
-static int request_preprocess(call_t *call, phone_t *phone)
+static errno_t request_preprocess(call_t *call, phone_t *phone)
 {
 	call->request_method = IPC_GET_IMETHOD(call->data);
@@ -239,5 +239,5 @@
 static void process_answer(call_t *call)
 {
-	if (((int) IPC_GET_RETVAL(call->data) == EHANGUP) &&
+	if (((errno_t) IPC_GET_RETVAL(call->data) == EHANGUP) &&
 	    (call->flags & IPC_CALL_FORWARDED))
 		IPC_SET_RETVAL(call->data, EFORWARD);
@@ -271,5 +271,5 @@
  *
  */
-int ipc_req_internal(cap_handle_t handle, ipc_data_t *data, sysarg_t priv)
+errno_t ipc_req_internal(cap_handle_t handle, ipc_data_t *data, sysarg_t priv)
 {
 	kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE);
@@ -281,5 +281,5 @@
 	memcpy(call->data.args, data->args, sizeof(data->args));
 	
-	int rc = request_preprocess(call, kobj->phone);
+	errno_t rc = request_preprocess(call, kobj->phone);
 	if (!rc) {
 #ifdef CONFIG_UDEBUG
@@ -362,5 +362,5 @@
  *
  */
-sysarg_t sys_ipc_call_async_fast(sysarg_t handle, sysarg_t imethod,
+sys_errno_t sys_ipc_call_async_fast(sysarg_t handle, sysarg_t imethod,
     sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t label)
 {
@@ -389,5 +389,5 @@
 	call->data.label = label;
 	
-	int res = request_preprocess(call, kobj->phone);
+	errno_t res = request_preprocess(call, kobj->phone);
 	
 	if (!res)
@@ -409,5 +409,5 @@
  *
  */
-sysarg_t sys_ipc_call_async_slow(sysarg_t handle, ipc_data_t *data,
+sys_errno_t sys_ipc_call_async_slow(sysarg_t handle, ipc_data_t *data,
     sysarg_t label)
 {
@@ -422,10 +422,10 @@
 
 	call_t *call = ipc_call_alloc(0);
-	int rc = copy_from_uspace(&call->data.args, &data->args,
+	errno_t rc = copy_from_uspace(&call->data.args, &data->args,
 	    sizeof(call->data.args));
-	if (rc != 0) {
+	if (rc != EOK) {
 		kobject_put(call->kobject);
 		kobject_put(kobj);
-		return (sysarg_t) rc;
+		return (sys_errno_t) rc;
 	}
 
@@ -433,5 +433,5 @@
 	call->data.label = label;
 	
-	int res = request_preprocess(call, kobj->phone);
+	errno_t res = request_preprocess(call, kobj->phone);
 	
 	if (!res)
@@ -466,5 +466,5 @@
  *
  */
-static sysarg_t sys_ipc_forward_common(sysarg_t chandle, sysarg_t phandle,
+static sys_errno_t sys_ipc_forward_common(sysarg_t chandle, sysarg_t phandle,
     sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3,
     sysarg_t arg4, sysarg_t arg5, unsigned int mode, bool slow)
@@ -482,5 +482,5 @@
 	
 	bool after_forward = false;
-	int rc;
+	errno_t rc;
 
 	kobject_t *pkobj = kobject_get(TASK, phandle, KOBJECT_TYPE_PHONE);
@@ -577,5 +577,5 @@
  *
  */
-sysarg_t sys_ipc_forward_fast(sysarg_t chandle, sysarg_t phandle,
+sys_errno_t sys_ipc_forward_fast(sysarg_t chandle, sysarg_t phandle,
     sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, unsigned int mode)
 {
@@ -601,12 +601,12 @@
  *
  */
-sysarg_t sys_ipc_forward_slow(sysarg_t chandle, sysarg_t phandle,
+sys_errno_t sys_ipc_forward_slow(sysarg_t chandle, sysarg_t phandle,
     ipc_data_t *data, unsigned int mode)
 {
 	ipc_data_t newdata;
-	int rc = copy_from_uspace(&newdata.args, &data->args,
+	errno_t rc = copy_from_uspace(&newdata.args, &data->args,
 	    sizeof(newdata.args));
-	if (rc != 0)
-		return (sysarg_t) rc;
+	if (rc != EOK)
+		return (sys_errno_t) rc;
 	
 	return sys_ipc_forward_common(chandle, phandle,
@@ -631,5 +631,5 @@
  *
  */
-sysarg_t sys_ipc_answer_fast(sysarg_t chandle, sysarg_t retval, sysarg_t arg1,
+sys_errno_t sys_ipc_answer_fast(sysarg_t chandle, sysarg_t retval, sysarg_t arg1,
     sysarg_t arg2, sysarg_t arg3, sysarg_t arg4)
 {
@@ -660,5 +660,5 @@
 	 */
 	IPC_SET_ARG5(call->data, 0);
-	int rc = answer_preprocess(call, saved ? &saved_data : NULL);
+	errno_t rc = answer_preprocess(call, saved ? &saved_data : NULL);
 	
 	ipc_answer(&TASK->answerbox, call);
@@ -678,5 +678,5 @@
  *
  */
-sysarg_t sys_ipc_answer_slow(sysarg_t chandle, ipc_data_t *data)
+sys_errno_t sys_ipc_answer_slow(sysarg_t chandle, ipc_data_t *data)
 {
 	kobject_t *kobj = cap_unpublish(TASK, chandle, KOBJECT_TYPE_CALL);
@@ -695,7 +695,7 @@
 		saved = false;
 	
-	int rc = copy_from_uspace(&call->data.args, &data->args, 
+	errno_t rc = copy_from_uspace(&call->data.args, &data->args, 
 	    sizeof(call->data.args));
-	if (rc != 0) {
+	if (rc != EOK) {
 		/*
 		 * Republish the capability so that the call does not get lost.
@@ -722,5 +722,5 @@
  *
  */
-sysarg_t sys_ipc_hangup(sysarg_t handle)
+sys_errno_t sys_ipc_hangup(sysarg_t handle)
 {
 	kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE);
@@ -728,5 +728,5 @@
 		return ENOENT;
 	
-	int rc = ipc_phone_hangup(kobj->phone);
+	errno_t rc = ipc_phone_hangup(kobj->phone);
 	kobject_put(kobj);
 	return rc;
@@ -742,5 +742,5 @@
  * @return An error code on error.
  */
-sysarg_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec,
+sys_errno_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec,
     unsigned int flags)
 {
@@ -800,5 +800,5 @@
 	
 	cap_handle_t handle;
-	int rc = cap_alloc(TASK, &handle);
+	errno_t rc = cap_alloc(TASK, &handle);
 	if (rc != EOK) {
 		goto error;
@@ -848,5 +848,5 @@
  *
  */
-sysarg_t sys_ipc_poke(void)
+sys_errno_t sys_ipc_poke(void)
 {
 	waitq_unsleep(&TASK->answerbox.wq);
@@ -866,5 +866,5 @@
  *
  */
-sysarg_t sys_ipc_irq_subscribe(inr_t inr, sysarg_t imethod, irq_code_t *ucode,
+sys_errno_t sys_ipc_irq_subscribe(inr_t inr, sysarg_t imethod, irq_code_t *ucode,
 	cap_handle_t *uspace_handle)
 {
@@ -883,5 +883,5 @@
  *
  */
-sysarg_t sys_ipc_irq_unsubscribe(sysarg_t cap)
+sys_errno_t sys_ipc_irq_unsubscribe(sysarg_t cap)
 {
 	if (!(perm_get(TASK) & PERM_IRQ_REG))
@@ -898,5 +898,5 @@
  *
  */
-sysarg_t sys_ipc_connect_kbox(task_id_t *uspace_taskid, cap_handle_t *uspace_phone)
+sys_errno_t sys_ipc_connect_kbox(task_id_t *uspace_taskid, cap_handle_t *uspace_phone)
 {
 #ifdef CONFIG_UDEBUG
@@ -904,5 +904,5 @@
 	cap_handle_t phone;
 	
-	int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(task_id_t));
+	errno_t rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(task_id_t));
 	if (rc == EOK) {
 		rc = ipc_connect_kbox((task_id_t) taskid, &phone);
@@ -917,7 +917,7 @@
 	}
 	
-	return (sysarg_t) rc;
+	return (sys_errno_t) rc;
 #else
-	return (sysarg_t) ENOTSUP;
+	return (sys_errno_t) ENOTSUP;
 #endif
 }
