28 lines
848 B
Groff
28 lines
848 B
Groff
SYSTEM CALLS
|
|
wait - wait for a child to terminate
|
|
|
|
INVOCATION
|
|
int wait( status )
|
|
int *status;
|
|
|
|
EXPLANATION
|
|
Wait(2) returns if a child has already terminated, or if
|
|
there are no children. Otherwise wait(2) blocks until a
|
|
child does terminate.
|
|
|
|
If wait(2) returns because a child terminated, and <status>
|
|
is not NULL, then the lowest byte of the location pointed to
|
|
by <status> will contain the signal number which terminated
|
|
the child, 0 for normal termination. On a normal termination
|
|
the next higher byte receives the value from the child's
|
|
exit(3) call. If a core dump was generated then 0x80 is OR'ed
|
|
into the status.
|
|
|
|
RESULTS
|
|
o/w : Process number of terminated child.
|
|
-1 : errno = ECHILD - No children.
|
|
= EINTR - A signal occurred.
|
|
|
|
REFERENCES
|
|
_exit(2), pause(2), exit(3)
|