mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
Kernel: Implement basic SIGSTOP and SIGCONT support.
This commit is contained in:
parent
c5a32d139a
commit
e427b514dc
3 changed files with 19 additions and 4 deletions
|
@ -810,10 +810,23 @@ ShouldUnblockProcess Process::dispatch_signal(byte signal)
|
|||
// Mark this signal as handled.
|
||||
m_pending_signals &= ~(1 << signal);
|
||||
|
||||
if (signal == SIGSTOP) {
|
||||
set_state(Stopped);
|
||||
return ShouldUnblockProcess::No;
|
||||
}
|
||||
if (signal == SIGCONT && state() == Stopped) {
|
||||
set_state(Runnable);
|
||||
return ShouldUnblockProcess::Yes;
|
||||
}
|
||||
|
||||
auto handler_laddr = action.handler_or_sigaction;
|
||||
if (handler_laddr.is_null()) {
|
||||
// FIXME: Is termination really always the appropriate action?
|
||||
terminate_due_to_signal(signal);
|
||||
if (signal == SIGSTOP) {
|
||||
set_state(Stopped);
|
||||
} else {
|
||||
// FIXME: Is termination really always the appropriate action?
|
||||
terminate_due_to_signal(signal);
|
||||
}
|
||||
return ShouldUnblockProcess::No;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue