Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!amdahl!kucharsk From: kucharsk@uts.amdahl.com (William Kucharski) Newsgroups: comp.unix.questions Subject: Re: Converting wait3() to System V Message-ID: Date: 16 Sep 89 02:49:19 GMT References: <10800032@bradley> Reply-To: kucharsk@amdahl.uts.amdahl.com (William Kucharski) Organization: Amdahl Coup, UTS Products Hen House Lines: 32 In article <10800032@bradley> vijay@bradley.UUCP writes: > >Hi: > I hope you can give me some pointers. I am trying to port >an application from a 4.3 BSD UNIX to System V. There is a >wait3() call in the application that needs to be converted to >System V wait() or equivalent. And that's where I am stuck. Any help >would be appreciated. > >Thanks in advance... It depends upon the parameters you're trying to feed to the wait3() call. If you're just trying to do a WNOHANG-style non-blocking wait, try something along the lines of (PSEUDO-C Code Follows): alarm(1); /* set alarm time for around 1 second */ pid = wait(&status); /* blocking wait(2) */ alarm(0); /* reset alarm */ If the wait succeeds - no problem. If it doesn't, it will be awakened by the alarm call. -- =============================================================================== | ARPA: kucharsk@uts.amdahl.com | William Kucharski | | UUCP: ...!{ames,apple,sun,uunet}!amdahl!kucharsk | Amdahl Corporation | =============================================================================== | Saying: "It's a window system named 'X,' NOT a system named 'X Windows'" | =============================================================================== | Disclaimer: "The opinions expressed above may not agree with mine at any | | other moment in time, so they certainly can't be those of my | | employer." | ===============================================================================