From 258f4671ea37f2218a4f600f1d0a34a1fa752237 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 28 Feb 2019 09:44:48 +0100 Subject: [PATCH] Kernel: kill() syscall should support sending a signal to yourself. --- Kernel/Process.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 0a8fc36ada..954e56d0c2 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -1419,7 +1419,11 @@ int Process::sys$kill(pid_t pid, int signal) // FIXME: Send to all processes. ASSERT(pid != -1); } - ASSERT(pid != current->pid()); // FIXME: Support this scenario. + if (pid == m_pid) { + send_signal(signal, this); + Scheduler::yield(); + return 0; + } Process* peer = nullptr; { InterruptDisabler disabler;