Kernel: kill() syscall should support sending a signal to yourself.

This commit is contained in:
Andreas Kling 2019-02-28 09:44:48 +01:00
parent 166aadc4e1
commit 258f4671ea

View file

@ -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;