diff options
author | Anton Kling <anton@kling.gg> | 2024-12-11 14:56:58 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-12-12 15:48:19 +0100 |
commit | bc828883c51c3c0f35872019f4db632e4ce82dc5 (patch) | |
tree | c4217493e69e4e8078aa403ca23f71fdf598f826 /kernel/cpu | |
parent | b343b0dae5aa51b5bd9b195936358341a943b3b2 (diff) |
procfs: Add a procfs
Userland can now interface with processes by writing/reading from
`/proc/<pid>/<entry>`
It can send signals, for example `echo 15 > /proc/1/signal`
Diffstat (limited to 'kernel/cpu')
-rw-r--r-- | kernel/cpu/syscall.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/cpu/syscall.c b/kernel/cpu/syscall.c index a78e63e..31f1fc5 100644 --- a/kernel/cpu/syscall.c +++ b/kernel/cpu/syscall.c @@ -427,6 +427,8 @@ void syscall_wait(int *status) { if (status) { *status = current_task->child_rc; } + process_remove_reference(current_task->child); + current_task->child = NULL; return; } do { @@ -444,6 +446,10 @@ void syscall_wait(int *status) { if (status) { *status = current_task->child_rc; } + if (current_task->child->dead) { + process_remove_reference(current_task->child); + current_task->child = NULL; + } } int syscall_fork(void) { |