Path: utzoo!mnetor!uunet!mcvax!unido!pcsbst!jh From: jh@pcsbst Newsgroups: comp.unix.questions Subject: Re: wait3 emulation in SYSTEMV ?? - (nf) Message-ID: <4200004@pcsbst.UUCP> Date: 18 Jan 88 09:20:00 GMT References: <360@rruxa.UUCP> Lines: 37 Nf-ID: #R:rruxa:-36000:pcsbst:4200004:000:863 Nf-From: pcsbst!jh Jan 18 10:20:00 1988 The newer versions of System V provide the possibilty to check the existence of a process by sending a signal 0 to the process in question and checking for an error return. This would allow you to write a write a pseudo wait3() function for terminated processes: int wait3_for_sysV (testpid, status, options, rusage) int testpid; union wait * status; int options; struct rusage * rusage; /* not used */ { .... if (options & WNOHANG) { if (kill (testpid, 0) == -1) { if (errno != EPERM) return (wait (status)); else return (BUG); } else { return (STILLRUNNING); } } else { return (wait (status)); } } This is only an example. Check for possible different error returns of the kill() system call. For a better implementation you should poll all pids in question. I hope this did help you. Johannes Heuft unido!pcsbst!jh