Index: generic/src/syscall/syscall.c
===================================================================
--- generic/src/syscall/syscall.c	(revision 41d33aca6323fda79c1a11fc827a1a73ba58c85f)
+++ generic/src/syscall/syscall.c	(revision e090e1bc608c034d91ca98e260828ceb2310c808)
@@ -91,8 +91,24 @@
 			 __native a4, __native id)
 {
+	__native rc;
+	ipl_t ipl;
+	bool exit = false;
+
 	if (id < SYSCALL_END)
-		return syscall_table[id](a1,a2,a3,a4);
+		rc = syscall_table[id](a1,a2,a3,a4);
 	else
 		panic("Undefined syscall %d", id);
+		
+	ipl = interrupts_disable();
+	spinlock_lock(&THREAD->lock);
+	if (THREAD->interrupted)
+		exit = true;
+	spinlock_unlock(&THREAD->lock);
+	interrupts_restore(ipl);
+	
+	if (exit)
+		thread_exit();
+	
+	return rc;
 }
 
