1
Fork 0
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:
Andreas Kling 2019-02-28 12:27:26 +01:00
parent c5a32d139a
commit e427b514dc
3 changed files with 19 additions and 4 deletions

View file

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