Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii)
Subject: Re: Zombies are haunting me! HELP!
Date: 1998/05/28	[thread overview]
Message-ID: <6kk3t6$jau@ds2.acs.ucalgary.ca> (raw)
In-Reply-To: x7ogwjmngx.fsf@hexadecimal.uoregon.edu


Steve VanDevender (stevev@hexadecimal.uoregon.edu) wrote:

: Quite simply, the parent must issue a wait() system call for each
: child that it forks.  A child will remain in a zombie state until

Quite simply, this assertion is wrong if taken literally. If the 
parent process is not interested in the child's exit codes, it
is possible to arrange for dead children to be disposed of without
parent's interverntion. The sigaction(2) manual page provides all
the gory details, but in practice doing:

	struct	sigaction  action ;

action.sa_handler = SIG_IGN ;
action.sa_mask    = 0 ;
action.sa_flags   = SA_NOCLDSTOP|SA_NOCLDWAIT ;
sigaction( SIGCHLD, &action, NULL ) ;

will make waiting for your childs not necessary. (It is still
possible to synchronize with the children processes, see wait(2)
and sigaction(2) manual pages). On some other unices (e.g. AIX), 
simply setting SIGCHLD to SIG_IGN by doing signal(SIGCHLD,SIG_IGN) 
will have the same effect. On Digital Unix, the same behaviour 
can be obtained by linking with system V compatibility library 
(-lsys5), even though I cannot find any references to this in 
the manual pages. Linking either with bsd signals library, or 
with the default libc handler will result in zombies.

As usual, there is more than one way to skin a cat.

/Serge.P




  reply	other threads:[~1998-05-28  4:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-26  4:00 Zombies are haunting me! HELP! William Clark
1998-05-27  4:00 ` Steve VanDevender
1998-05-28  4:00   ` Serguei Patchkovskii [this message]
1998-05-27  4:00 ` news.encomix.es
1998-05-28  4:00 ` Jeff Denham
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox