Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!indri!polyslo!vlsi3b15!lehi3b15!murrey From: murrey@lehi3b15.csee.Lehigh.EDU (Erik Murrey) Newsgroups: comp.unix.wizards Subject: System V / SIGCLD questions... Message-ID: <565@lehi3b15.csee.Lehigh.EDU> Date: 11 May 89 17:37:33 GMT Reply-To: murrey@lehi3b15.csee.Lehigh.EDU (Erik Murrey) Organization: CSEE Dept. Lehigh University, Bethlehem, PA Lines: 33 Here's one I can't figure out... I'm writing a routine (like reapchildren(), found all over the place in BSD code), using the SIGCLD signal to invoke it. Its job is to execute a wait(2) on all of the children that have died, getting their exit status, etc. Now for the problem: It seems (according to the man page for signal(2)) that during the signal handler for SIGCLD (reapchildren()), any further SIGCLD's will be ignored. By the same token, I can't do a non-blocking wait() in System V, so I can't repeatedly call wait() (I might have other children that haven't exit()-ed yet) Here is what happens: If I have spawned a few children, and one just did an exit(), then my reapchildren() signal handler gets called. It does a wait(), gets the exit status, and gets out of there (after resetting the SIGCLD signal). If by chance a second child dies while we are within the reapchildren() handler, I never get notified of it... How can I get around this? If only I had wait3()... ... Erik -- Erik Murrey Lehigh University murrey@csee.Lehigh.EDU erik@mpx.com