How to get Status of processes in C environment

Guy Harris guy at auspex.auspex.com
Wed Sep 12 04:32:10 AEST 1990


>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. 



More information about the Comp.unix.questions mailing list