RE: [LIP] SIGCHLD behaviour...

omanakuttan <omanakuttan-Ig93jE4/[email protected]>
Newsgroups gmane.user-groups.linux.india.programmers
Message-ID <Pine.LNX.4.44.0404151601410.4478-100000@ipsec-host-251-145.vpn.pace.co.uk>
On Thu, 15 Apr 2004, Sameer Oak wrote:
> ok. but why is it needed to set the action to ignore explicitly?
It is required by POSIX.
> 
> > Else, even though the default action is ignore, it will never be delivered
> > to the process.
> ...
> the default action of SIGCHLD is to ignore, thus that is never delivered to
> the parent.
> 
> the ``else'' and ``even though'' have a bit of irony. kindly explain if
> am getting it wrong.
signalling has two parts : 1. generation and 2. delivery
generation : 
1. Default action (ignore)
The siginfo_t table of the destination process is untouched. handler =
SIG_DFL
2. eXPLICITLY setting ignore
The siginfo_t table should add one entry with handler = SIG_IGN.

Ignore is an action.

Delivery : 
If the action is to ignore, do_signal() will continue with the next signal.
if handler == SIG_IGN, and signal number is SIGCHLD, kernel willdo
    sys_wait4().
if default action (i.e, to ignore), handler is SIG_DFL, there will not be
    any sys_wait4(), but the loop will continue with next signal processing.
HTH.

> 
> > And init will have to take care fo zonbies and other children.
> ...
> this sounds bit different to me! init becomes parent of all the orphan
> processes and thus clears the zombies
> from process table.
> in what all circumstances does init handle zombies? i've never seen init
> clearing zombies if SIGCHLD is
> ignored by either explicitly setting it to SIG_IGN or not setting it.
> kindly explain.
Sorry, I should have said "If parent dies, init will have3 to clear zonbies"
> -



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.