From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fee84,782002c31f9c8f6c X-Google-Attributes: gidfee84,public From: Jeff Denham Subject: Re: Zombies are haunting me! HELP! Date: 1998/05/28 Message-ID: <356D8DDF.EE36142C@brighttiger.com>#1/1 X-Deja-AN: 357342223 Content-Transfer-Encoding: 8bit References: <6ken58$9e0@examiner.concentric.net> Content-Type: text/plain; charset=iso-8859-1 Organization: Bright Tiger Technologies MIME-Version: 1.0 NNTP-Posting-Date: Thu, 28 May 1998 12:19:45 EDT Newsgroups: comp.unix.osf.osf1 William Clark wrote: > Hello there, > > I am writing c code on a DEC Alpha box running DEC Unix. > > I have created a daemon that forks a child to receive a file > from a remote process. > > Everything works great EXCEPT that I am collecting a zombie > for each terminated child process. > > I am using the signal function with SIGCHLD,SIG_IGN params before > I start the loop that waits for a sockets connection and forks > the child. > > I thought that would prevent zombies. > > Any ideas would be appreciated. Thanks in advance. > > billc You're expecting System V semantics, and you don't get that by default for the signal() function on Digital UNIX. If you build in the UNIX 95 environment (using c89 instead of cc) or add -lsys5 to your link command, you'll get the behavior you're expecting. However, the best way to do this is to switch to the POSIX sigaction routine using an sa_flags value of SA_NOCLDWAIT in your call for SIGCHLD. This eliminates the need to call wait() as well. See the sigaction man page. Jeff __________________________________________________ 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