* Signals and defuct children
@ 1998-04-27 4:00 J Grotto
1998-04-28 4:00 ` Jeff Denham
0 siblings, 1 reply; 2+ messages in thread
From: J Grotto @ 1998-04-27 4:00 UTC (permalink / raw)
I have a piece of C code that uses the fucntion
signal(SIGCHLD, SIG_IGN);
Under many UNIX environments this allows forked child processes to terminate
without requiring additional handling by the parent.
Under Digital UNIX however the child processes remain defunct.
What is the appropriate method for handling this?
If I replace the signal function with the compatibility function
bsd_signal() the code works as I would expect. How are these functions
different in the way they handle child process termination.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Signals and defuct children
1998-04-27 4:00 Signals and defuct children J Grotto
@ 1998-04-28 4:00 ` Jeff Denham
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Denham @ 1998-04-28 4:00 UTC (permalink / raw)
J Grotto wrote:
> I have a piece of C code that uses the fucntion
>
> signal(SIGCHLD, SIG_IGN);
>
> Under many UNIX environments this allows forked child processes to terminate
> without requiring additional handling by the parent.
>
> Under Digital UNIX however the child processes remain defunct.
>
> What is the appropriate method for handling this?
>
> If I replace the signal function with the compatibility function
> bsd_signal() the code works as I would expect. How are these functions
> different in the way they handle child process termination.
You're seeing the original BSD behavior of signal(),
which has no effect on the zombification of child
processes. The cleanest way to get what you want is
to switch to sigaction() and specific SA_CLDNOWAIT
in the sa_flags field. This is equivalent to setting
SIGCHLD to SIG_IGN under the UNIX 95 enviroment (using
the c89 compiler).
See the sigaction(2) man page for more details.
__________________________________________________
Jeff Denham (jdenham@brighttiger.com)
Bright Tiger Technologies
SmartCluster� Software for Distributed Web Servers
http://www.brighttiger.com
125 Nagog Park
Acton, MA 01720
Phone: (978) 263-5455 x177
Fax: (978) 263-5547
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-04-28 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-04-27 4:00 Signals and defuct children J Grotto
1998-04-28 4:00 ` Jeff Denham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox