From: Jeff Denham <jdenham@brighttiger.com>
Subject: Re: Zombies are haunting me! HELP!
Date: 1998/05/28 [thread overview]
Message-ID: <356D8DDF.EE36142C@brighttiger.com> (raw)
In-Reply-To: 6ken58$9e0@examiner.concentric.net
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
prev parent 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
1998-05-27 4:00 ` news.encomix.es
1998-05-28 4:00 ` Jeff Denham [this message]
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