Path: utzoo!attcan!uunet!virtech!cpcahil From: cpcahil@virtech.uucp (Conor P. Cahill) Newsgroups: comp.unix.questions Subject: Re: Can process do an asynchronous wait? Message-ID: <1990May31.133601.15616@virtech.uucp> Date: 31 May 90 13:36:01 GMT References: <30343@cup.portal.com> Reply-To: cpcahil@virtech.UUCP (Conor P. Cahill) Organization: Virtual Technologies Inc., Sterling VA Lines: 17 In article <30343@cup.portal.com> tms@cup.portal.com (Alexis TMS Tatarsky) writes: >If a process forks and execs several child processes, is there any >way for the parent to detect when the child processes have exited >or died without having to wait(2) on them. I wrote a program where >the parent caught SIGCLD but I don't know which child it is which >died. The signal handler for the SIGCLD should do a wait() which will provide the process id and exit status of the child. The fact that you got a SIGCLD tells you that the wait will not block, so you don't have to worry about getting stuck in there. -- Conor P. Cahill (703)430-9247 Virtual Technologies, Inc., uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160 Sterling, VA 22170