Implement sigaction(2) SA_RESETHAND.
This commit is contained in:
parent
a90151e508
commit
ab27c85948
|
@ -767,11 +767,16 @@ retry_another_signal:
|
||||||
// Update the current registers.
|
// Update the current registers.
|
||||||
Scheduler::LoadInterruptedContext(intctx, &handler_regs);
|
Scheduler::LoadInterruptedContext(intctx, &handler_regs);
|
||||||
|
|
||||||
// TODO: SA_RESETHAND:
|
// Reset the signal handler if this signal handler is once only.
|
||||||
// "If set, the disposition of the signal shall be reset to SIG_DFL
|
if ( action->sa_flags & SA_RESETHAND )
|
||||||
// and the SA_SIGINFO flag shall be cleared on entry to the signal
|
{
|
||||||
// handler. Note: SIGILL and SIGTRAP cannot be automatically reset
|
// POSIX mandates SA_RESETHAND is silently ignored for these signals.
|
||||||
// when delivered; the system silently enforces this restriction."
|
if ( signum != SIGILL && signum != SIGTRAP )
|
||||||
|
{
|
||||||
|
action->sa_flags &= ~SA_RESETHAND;
|
||||||
|
action->sa_handler = SIG_DFL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Run the signal handler by returning to user-space.
|
// Run the signal handler by returning to user-space.
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue