On Sat, Oct 13, 2012 at 9:38 PM, David Higgs <[email protected]> wrote:
> Signal delivery can be nested/reentrant. Calling raise(3) in a signal
> handler -- even with the same signal number -- will work as expected
> (until you blow your stack).

By default, a signal is deferred when the signal itself is being
handled; c.f. the SA_NODEFER flag on the sigaction(2) manpage.  If
that isn't set then raising the signal in its own signal handler will
just result in it being pending until you return from the signal
handler, at which point the signal mask will be restored and the
pending signal will be delivered.  (That's specified by POSIX.)


> What I'm not sure about is when multiple, identical signals arrive
> *before* the signal handler is invoked.  A naive interpretation of
> sigpending(2) suggests only one of each signal can be pending at a
> time.  However, the kernel could place multiple signal contexts on the
> stack before invoking any handlers, and then userland will process
> them in LIFO order.

OpenBSD doesn't support signal queuing; a signal sent to a process
while that signal is already pending for the process will be ignored.


Philip Guenther

Reply via email to