From bc828883c51c3c0f35872019f4db632e4ce82dc5 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Wed, 11 Dec 2024 14:56:58 +0100 Subject: procfs: Add a procfs Userland can now interface with processes by writing/reading from `/proc//` It can send signals, for example `echo 15 > /proc/1/signal` --- kernel/cpu/syscall.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kernel/cpu') 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) { -- cgit v1.2.3