Path: utzoo!attcan!uunet!cs.utexas.edu!ico!ico.isc.com!dougm From: dougm@queso.ico.isc.com (Doug McCallum) Newsgroups: comp.unix.questions Subject: Re: SYS V SIGCLD Handling Message-ID: Date: 21 Nov 89 01:28:29 GMT References: <957@sdrc.UUCP> <1989Nov20.124459.26023@virtech.uucp> Sender: news@ico.ISC.COM Reply-To: dougm@ico.isc.com Organization: INTERACTIVE Systems Corporation Lines: 19 In-reply-to: cpcahil@virtech.uucp's message of 20 Nov 89 12:44:59 GMT In article <1989Nov20.124459.26023@virtech.uucp> cpcahil@virtech.uucp (Conor P. Cahill) writes: In article <957@sdrc.UUCP>, scjones@sdrc.UUCP (Larry Jones) writes: ... > When I run this on my Sys Vr3.0 system, it goes into recursive > death. As soon as the handler calls signal to reestablish > itself, it is immediately reinvoked. Am I doing something wrong, Yes. You need to wait for the child in the handler. If you have more than one possible child, you need to wait for however many of them there could be (usually you use alarm() to time out the wait). You only need to wait for one child in the signal handler. With SYSV, the SIGCLD handler will be called once for each child process that dies. By waiting for just one and returning, you will get called for each exiting child with no need to timeout with an alarm. Another difference between SYSV and BSD handling of SIGCLD/SIGCHLD is that with SYSV if you set the signal handler to SIG_IGN, the zombie will be handled without being waited for.