mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
Kernel: Expose the signal that stopped a thread via sys$waitpid()
This commit is contained in:
parent
638fe6f84a
commit
5163c5cc63
3 changed files with 11 additions and 2 deletions
|
@ -2318,12 +2318,16 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
|
|||
if (!waitee_process)
|
||||
return -ECHILD;
|
||||
|
||||
auto* waitee_thread = Thread::from_tid(waitee_pid);
|
||||
if (!waitee_thread)
|
||||
return -ECHILD;
|
||||
|
||||
ASSERT(waitee_process);
|
||||
if (waitee_process->is_dead()) {
|
||||
exit_status = reap(*waitee_process);
|
||||
} else {
|
||||
ASSERT(waitee_process->any_thread().state() == Thread::State::Stopped);
|
||||
exit_status = 0x7f;
|
||||
ASSERT(waitee_thread->state() == Thread::State::Stopped);
|
||||
exit_status = (waitee_thread->m_stop_signal << 8) | 0x7f;
|
||||
}
|
||||
|
||||
if (wstatus)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue