Index: generic/src/ipc/ipc.c
===================================================================
--- generic/src/ipc/ipc.c	(revision 84977110e48d0fb14137dbbd48504fcb1840984a)
+++ generic/src/ipc/ipc.c	(revision 125e9443d523f71aa23ce4cf31996b4c7a54ad2c)
@@ -34,4 +34,5 @@
 #include <synch/spinlock.h>
 #include <synch/waitq.h>
+#include <synch/synch.h>
 #include <ipc/ipc.h>
 #include <errno.h>
@@ -142,5 +143,5 @@
 
 	ipc_call(phone, request);
-	ipc_wait_for_call(&sync_box, 0);
+	ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING);
 }
 
@@ -302,18 +303,22 @@
 /** Wait for phone call 
  *
+ * @param box Answerbox expecting the call.
+ * @param usec Timeout in microseconds. See documentation for waitq_sleep_timeout() for
+ *	       decription of its special meaning.
+ * @param nonblocking Blocking vs. non-blocking operation mode switch. See documentation
+ *		      for waitq_sleep_timeout() for description of its special meaning.
  * @return Recived message address
  * - to distinguish between call and answer, look at call->flags
  */
-call_t * ipc_wait_for_call(answerbox_t *box, int flags)
+call_t * ipc_wait_for_call(answerbox_t *box, __u32 usec, int nonblocking)
 {
 	call_t *request;
 	ipl_t ipl;
-
-restart:      
-	if (flags & IPC_WAIT_NONBLOCKING) {
-		if (waitq_sleep_timeout(&box->wq,0,1) == ESYNCH_WOULD_BLOCK)
-			return NULL;
-	} else 
-		waitq_sleep(&box->wq);
+	int rc;
+
+restart:
+	rc = waitq_sleep_timeout(&box->wq, usec, nonblocking);
+	if (SYNCH_FAILED(rc))
+		return NULL;
 	
 	spinlock_lock(&box->lock);
@@ -408,5 +413,5 @@
 	/* Wait for all async answers to arrive */
 	while (atomic_get(&task->active_calls)) {
-		call = ipc_wait_for_call(&task->answerbox, 0);
+		call = ipc_wait_for_call(&task->answerbox, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING);
 		ASSERT((call->flags & IPC_CALL_ANSWERED) || (call->flags & IPC_CALL_NOTIF));
 		ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));
Index: generic/src/ipc/sysipc.c
===================================================================
--- generic/src/ipc/sysipc.c	(revision 84977110e48d0fb14137dbbd48504fcb1840984a)
+++ generic/src/ipc/sysipc.c	(revision 125e9443d523f71aa23ce4cf31996b4c7a54ad2c)
@@ -469,13 +469,15 @@
  *
  * @param calldata Pointer to buffer where the call/answer data is stored 
- * @param flags
+ * @param usec Timeout. See waitq_sleep_timeout() for explanation.
+ * @param nonblocking See waitq_sleep_timeout() for explanation.
+ *
  * @return Callid, if callid & 1, then the call is answer
  */
-__native sys_ipc_wait_for_call(ipc_data_t *calldata, __native flags)
+__native sys_ipc_wait_for_call(ipc_data_t *calldata, __u32 usec, int nonblocking)
 {
 	call_t *call;
 
 restart:	
-	call = ipc_wait_for_call(&TASK->answerbox, flags);
+	call = ipc_wait_for_call(&TASK->answerbox, usec, nonblocking);
 	if (!call)
 		return 0;
