Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 May 2013 07:57:02 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Noel Hunt <noel.hunt@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: signal vs. sigaction and SIGCHLD
Message-ID:  <20130521075702.6d59bbac.freebsd@edvax.de>
In-Reply-To: <CAGfO01wE7ZROQWTv7TXZdSySqWCkRqj7dcqDDc28-jvhqMuVDw@mail.gmail.com>
References:  <CAGfO01wE7ZROQWTv7TXZdSySqWCkRqj7dcqDDc28-jvhqMuVDw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130521075702.6d59bbac.freebsd>