diff options
-rw-r--r-- | src/init/tests/main.c | 5 | ||||
-rw-r--r-- | src/kernel/syscalls.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/init/tests/main.c b/src/init/tests/main.c index c59b390..0ac399b 100644 --- a/src/init/tests/main.c +++ b/src/init/tests/main.c @@ -133,6 +133,10 @@ static void test_malloc(void) { free(p1); } +static void test_misc(void) { + assert(_syscall(~0, 0, 0, 0, 0) < 0); /* try making an invalid syscall */ +} + static void stress_fork(void) { /* run a lot of processes */ for (size_t i = 0; i < 2048; i++) { @@ -150,5 +154,6 @@ void test_all(void) { run_forked(test_memflag); run_forked(test_malloc); run_forked(test_pipe); + run_forked(test_misc); run_forked(stress_fork); } diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index 05616a3..ae8b0e5 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -365,8 +365,8 @@ int _syscall(int num, int a, int b, int c, int d) { _syscall_debug_klog((userptr_t)a, b); break; default: - kprintf("unknown syscall "); - panic_unimplemented(); // TODO fail gracefully + regs_savereturn(&process_current->regs, -1); + break; } /* return value is unused. execution continues in sysenter_stage2 */ |