Node:BSD Wait Functions, Next:Process Creation Example, Previous:Process Completion Status, Up:Processes
The GNU library also provides these related facilities for compatibility
with BSD Unix. BSD uses the union wait
data type to represent
status values rather than an int
. The two representations are
actually interchangeable; they describe the same bit patterns. The GNU
C Library defines macros such as WEXITSTATUS
so that they will
work on either kind of object, and the wait
function is defined
to accept either type of pointer as its status-ptr argument.
These functions are declared in sys/wait.h
.
union wait | Data Type |
This data type represents program termination status values. It has
the following members:
Instead of accessing these members directly, you should use the equivalent macros. |
The wait3
function is the predecessor to wait4
, which is
more flexible. wait3
is now obsolete.
pid_t wait3 (union wait *status-ptr, int options, struct rusage *usage) | Function |
If usage is a null pointer, wait3 is equivalent to
waitpid (-1, status-ptr, options) .
If usage is not null, |