From 32810a920f892f8f99c400da45e79166fdfc583f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 22 Aug 2019 21:16:49 +0200 Subject: [PATCH] Kernel: Implement kill(0, signal) This sends the signal to everyone in the same process group as the calling process. --- Kernel/Process.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 3f81dd5f2d..b0b4ccfa59 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -1298,8 +1298,11 @@ int Process::sys$kill(pid_t pid, int signal) if (signal < 0 || signal >= 32) return -EINVAL; if (pid == 0) { - // FIXME: Send to same-group processes. - ASSERT(pid != 0); + Process::for_each_in_pgrp(pgid(), [&](auto& process) { + process.send_signal(signal, this); + return IterationDecision::Continue; + }); + return 0; } if (pid == -1) { // FIXME: Send to all processes.