diff options
author | dzwdz | 2022-04-09 19:09:31 +0200 |
---|---|---|
committer | dzwdz | 2022-04-09 19:09:31 +0200 |
commit | 4f64ef0f835d44c9a3220c414a6f35d05cb47690 (patch) | |
tree | abf7924d272a61e9ff8a6379cf2b4cf2738a4dab /src/kernel/syscalls.c | |
parent | b1acaafbb003ba6a5c20bd58d0fb7314c25a1cdc (diff) |
kernel: prevent switching processes in syscall handlers
Diffstat (limited to 'src/kernel/syscalls.c')
-rw-r--r-- | src/kernel/syscalls.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index 855fad8..85db57a 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -27,11 +27,11 @@ int _syscall_await(void) { has_children = true; } - if (has_children) - process_switch_any(); // wait until a child dies - else { + if (!has_children) { process_current->state = PS_RUNNING; return ~0; // TODO errno + } else { + return -1; } } @@ -217,9 +217,8 @@ int _syscall_fs_wait(char __user *buf, int max_len, struct fs_wait_response __us struct process *queued = backend->queue; backend->queue = queued->waits4fs.queue_next; return vfs_request_accept(&queued->waits4fs.req); - } else { - process_switch_any(); } + return -1; } int _syscall_fs_respond(char __user *buf, int ret) { |