All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.
@(#)wait.2 4.1 (Berkeley) 05/09/85
wait(status) int *status;
wait(0)
If (int) status is nonzero, the high byte of the word pointed to receives the low byte of the argument of exit when the child terminated. The low byte receives the termination status of the process. See signal (2) 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. See ptrace (2). If the 0200 bit of the termination status is set, a core image of the process was produced by the system.
If the parent process terminates without waiting on its children, the initialization process (process ID = 1) inherits the children.
There is another entry wait3 (2) which is provides additional options needed by the shell csh (1) to do job control.
sys wait
(process ID in r0)
(status in r1)
The high byte of the status is the low byte of r0 in the child at termination.