From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fee84,70dbfbd55e4bdf89 X-Google-Attributes: gidfee84,public From: Jeff Denham Subject: Re: Signals and defuct children Date: 1998/04/28 Message-ID: <3545E439.E65B33F6@brighttiger.com>#1/1 X-Deja-AN: 348419145 Content-Transfer-Encoding: 8bit References: <6i2579$71h@news-central.tiac.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Organization: Bright Tiger Technologies Newsgroups: comp.unix.osf.osf1 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