Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!uflorida!indri!polyslo!vlsi3b15!lehi3b15!murrey From: murrey@lehi3b15.csee.Lehigh.EDU (Erik Murrey) Newsgroups: comp.unix.wizards Subject: Re: System V / SIGCLD questions... Message-ID: <567@lehi3b15.csee.Lehigh.EDU> Date: 13 May 89 00:56:59 GMT References: <565@lehi3b15.csee.Lehigh.EDU> <17457@mimsy.UUCP> Reply-To: murrey@lehi3b15.csee.Lehigh.EDU (Erik Murrey) Organization: CSEE Dept. Lehigh University, Bethlehem, PA Lines: 36 In article <17457@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >In article <565@lehi3b15.csee.Lehigh.EDU> murrey@lehi3b15.csee.Lehigh.EDU >(Erik Murrey) writes: >> ... > ... >This means that a catcher routine written as > > catch() > { > int w, status; > > signal(SIGCLD, catch); > w = wait(&status); > } > >recurses infinitely as soon as one child exits. Yes, and in fact I tried this once before, and it did go into an endless loop after the first catch(). So my solution is to reset the sigcld signal after the wait(). Doesn't this leave a window where a child can die, and I won't ever know about it? At least they could have given me a SIG_HOLD... . . . . -- Erik Murrey Lehigh University murrey@csee.Lehigh.EDU erik@mpx.com