1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:47:45 +00:00

Kernel: Add support for the WSTOPPED flag to the waitpid() syscall.

This makes waitpid() return when a child process is stopped via a signal.
Use this in Shell to catch stopped children and return control to the
command line. :^)

Fixes #298.
This commit is contained in:
Andreas Kling 2019-07-14 11:35:49 +02:00
parent de03b72979
commit 3073ea7d84
6 changed files with 44 additions and 20 deletions

View file

@ -411,7 +411,7 @@ inline void Process::for_each_child(Callback callback)
for (auto* process = g_processes->head(); process;) {
auto* next_process = process->next();
if (process->ppid() == my_pid) {
if (!callback(*process))
if (callback(*process) == IterationDecision::Break)
break;
}
process = next_process;