summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/syscalls.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c
index be1a6c2..8636a1b 100644
--- a/src/kernel/syscalls.c
+++ b/src/kernel/syscalls.c
@@ -9,7 +9,10 @@
#include <shared/syscalls.h>
#include <stdint.h>
-#define SYSCALL_RETURN(val) return regs_savereturn(&process_current->regs, val)
+#define SYSCALL_RETURN(val) do { \
+ assert(process_current->state == PS_RUNNING); \
+ return regs_savereturn(&process_current->regs, val); \
+} while (0)
_Noreturn void _syscall_exit(int ret) {
process_kill(process_current, ret);
@@ -34,9 +37,9 @@ int _syscall_await(void) {
if (!has_children) {
process_transition(process_current, PS_RUNNING);
SYSCALL_RETURN(~0); // TODO errno
- } else {
- SYSCALL_RETURN(-1);
}
+
+ return -1; // dummy
}
int _syscall_fork(int flags, handle_t __user *fs_front) {