Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!ncar!boulder!iscden!jbev From: jbev@iscden.UUCP ( J B Systems) Newsgroups: comp.unix.questions Subject: Re: SYSV r3.2 - how to implement wait3 BSD function Message-ID: <255@iscden.UUCP> Date: 22 Aug 90 18:00:25 GMT References: <114@npdiss1.StPaul.NCR.COM> Organization: J B Systems on HiPeak, Morrison, Co. Lines: 48 In article <114@npdiss1.StPaul.NCR.COM> mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) writes: >More porting help needed - what is an equivalent SYSV r3.2 call for >a BSD wait3(). Specifically, a wait3 (&status, WNOHANG, ...) > >TIA >-- > >Dan Mercer >Reply-To: mercer@npdiss1.StPaul.NCR.COM (Dan Mercer) >"MAN - the only one word oxymoron in the English Language" Here is the code I used to emulate the wait3 BSD function on SCO UNIX. Hope it will fix you right up. -------------------code fragments follow--------------- register int childPid; #if defined(SYSV_UNIX) while ((childPid = waitpid(NULL, &w, WUNTRACED | WNOHANG)) > 0) { #else while ((childPid = wait3(&w, WUNTRACED | WNOHANG, (struct rusage *)NULL)) > 0) { #endif if (WIFSTOPPED(w)) { fprintf(stderr,"%s: Child %d Stopped.\r\n", ProgramName, childPid); } else if (WIFEXITED(w)) { fprintf(stderr,"%s: Child %d Exited.\r\n", ProgramName, childPid); } else if (WIFSIGNALED(w)) { fprintf(stderr,"%s: Child %d Killed.\r\n", ProgramName, childPid); } --------------------end of code-------------------- Jim Bevier --- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ +=+ From the mountains of Colorado: +=+ +=+ when it's not snowing, the sun is shining +=+ +=+ Jim Bevier - J B Systems (303)-697-1038 +=+ +=+ 10136 Horizon View, Morrison, CO 80465 +=+ +=+ jbev@iscden.UUCP or ...{ico,boulder}!iscden!jbev +=+ +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+