*BSD News Article 17558


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!ariel.ucs.unimelb.EDU.AU!werple.apana.org.au!news
From: andrew@werple.apana.org.au (Andrew Herbert)
Newsgroups: comp.unix.bsd
Subject: Re: How to prevent zombies?
Date: 27 Jun 1993 19:24:30 +1000
Organization: werple public-access unix, Melbourne
Lines: 23
Message-ID: <20jp0e$cgk@werple.apana.org.au>
References: <5909@bartal.BARTAL.COM>
NNTP-Posting-Host: werple.apana.org.au

phillip@BARTAL.COM (Phillip M. Vogel) writes:

>I'm porting some software from SVr3 to BSDI's BSD/386, and I've run into a 
>problem with zombie processes piling up.
...

This does the trick:

void reaper()
{
        int status;

        (void) wait(&status);
}

int main()
{
	...
	signal(SIGCHLD, reaper);
	...
}

Andrew