Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: How to get Status of processes in C environment Message-ID: <4049@auspex.auspex.com> Date: 11 Sep 90 18:32:10 GMT References: <25467.26e7ac6a@kuhub.cc.ukans.edu> <1990Sep8.221008.3145@ecn.purdue.edu> Organization: Auspex Systems, Santa Clara Lines: 13 >Try wait(2). Note the arg to the sys call is different on a BSD and SysV. Actually, from the kernel's standpoint, the argument is the *same* in BSD and other systems. Some excessively-helpful person at Berkeley created "union wait" as a *user-mode* wrapper around the "int" that the underlying implementation of "wait()", in most if not all UNIX systems, returns. If you just ignore "union wait" (and the "lint" complaints that doing so will give you), and treat the "status" argument to "wait()" as an "int *", even on BSD systems, your code will still work (unless the implementor of your UNIX system screwed up badly), but will be more portable and won't be polluted with #ifdefs.