signal vs. sigaction and SIGCHLD

Polytropon freebsd at edvax.de
Tue May 21 05:57:00 UTC 2013


On Tue, 21 May 2013 15:24:26 +1000, Noel Hunt wrote:
> If I recompile with `#undef SIGACTION', waithandler is not
> called.
> 
> I should add that even with the sigaction(2) interface, without
> the `sigprocmask' call, it still doesn't work, which suggests
> that SIGCHLD is being blocked.
> 
> Can anyone explain why?

>From reading "man 3 signal", I get the following impression:

     No    Name         Default Action       Description
     20    SIGCHLD      discard signal       child status has changed

The default action is to discard the signal, so the following
paragraph could make sense:

     The sig argument specifies which signal was received.  The func procedure
     allows a user to choose the action upon receipt of a signal.  To set the
     default action of the signal to occur as listed above, func should be
     SIG_DFL.  A SIG_DFL resets the default action.  To ignore the signal func
     should be SIG_IGN.  This will cause subsequent instances of the signal to
     be ignored and pending instances to be discarded.  If SIG_IGN is not
     used, further occurrences of the signal are automatically blocked and
     func is called.

>From my limited understanding, maybe this could help you find
an explanation of the observed behaviour?

Also compare /usr/include/sys/signal.h for the definition of
the involved typedef's.


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list