.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\" @(#)wait.2 4.1 (Berkeley) %G%
wait \- wait for process to terminate
causes its caller to delay until a signal is received or
If any child has died since the last
if there are no children, return is immediate with
(resp. with a value of \-1 returned).
The normal return yields the process ID of the terminated child.
In the case of several children several
to learn of all the deaths.
is nonzero, the high byte of the word pointed to
receives the low byte of the
when the child terminated.
receives the termination status
for a list of termination statuses (signals);
0 status indicates normal termination.
A special status (0177) is returned for a stopped process
which has not terminated and can be restarted.
If the 0200 bit of the termination status
a core image of the process was produced
If the parent process terminates without
the initialization process
which is provides additional options needed by the shell
wait3(2), exit(2), fork(2), signal(2)
\-1 if there are no children not previously waited for.
The high byte of the status is
the low byte of r0 in the child at termination.