Index: kernel/generic/include/errno.h
===================================================================
--- kernel/generic/include/errno.h	(revision b11ee8872cb2061cd04c3ebb8c53931f45068af2)
+++ kernel/generic/include/errno.h	(revision e06da7efc998285c1aa3d8a9ceb29e2a5aea6fdb)
@@ -49,13 +49,16 @@
 				 * Used by answerbox to close the connection.
 				 */
-#define EEXISTS		-8	/* Entry already exists */
-#define EBADMEM		-9	/* Bad memory pointer */
-#define ENOTSUP		-10	/* Not supported */
-#define EADDRNOTAVAIL	-11	/* Address not available. */
-#define ETIMEOUT        -12     /* Timeout expired */
-#define EINVAL          -13     /* Invalid value */
-#define EBUSY           -14     /* Resource is busy */
-#define EOVERFLOW	-15	/* The result does not fit its size. */
-#define EINTR		-16	/* Operation was interrupted. */
+#define EPARTY		-8	/* The other party encountered an error when
+				 * receiving the call.
+				 */
+#define EEXISTS		-9	/* Entry already exists */
+#define EBADMEM		-10	/* Bad memory pointer */
+#define ENOTSUP		-11	/* Not supported */
+#define EADDRNOTAVAIL	-12	/* Address not available. */
+#define ETIMEOUT        -13     /* Timeout expired */
+#define EINVAL          -14     /* Invalid value */
+#define EBUSY           -15     /* Resource is busy */
+#define EOVERFLOW	-16	/* The result does not fit its size. */
+#define EINTR		-17	/* Operation was interrupted. */
 
 #endif
Index: kernel/generic/src/ipc/sysipc.c
===================================================================
--- kernel/generic/src/ipc/sysipc.c	(revision b11ee8872cb2061cd04c3ebb8c53931f45068af2)
+++ kernel/generic/src/ipc/sysipc.c	(revision e06da7efc998285c1aa3d8a9ceb29e2a5aea6fdb)
@@ -937,9 +937,19 @@
 	 * copy whole call->data, not only call->data.args */
 	if (STRUCT_TO_USPACE(calldata, &call->data)) {
-		/* XXX
-		 * To avoid deadlocks in synchronous calls
-		 * this should be replaced by discarding
-		 * the call and notifying the caller.
+		/*
+		 * The callee will not receive this call and no one else has
+		 * a chance to answer it. Reply with the EPARTY error code.
 		 */
+		ipc_data_t saved_data;
+		int saveddata = 0;
+
+		if (answer_need_old(call)) {
+			memcpy(&saved_data, &call->data, sizeof(call->data));
+			saveddata = 1;
+		}
+		
+		IPC_SET_RETVAL(call->data, EPARTY);
+		(void) answer_preprocess(call, saveddata ? &saved_data : NULL);
+		ipc_answer(&TASK->answerbox, call);
 		return 0;
 	}
