wait for child process to change state
pid_t wait3 (int *stat_loc, int options, struct rusage *r_usage);
The wait3 function allows the calling process to obtain
status information for specified child processes.
for a description of the arguments to wait3.
Note that the following call:
wait3(stat_loc, options, r_usage);
is equivalent to the call:
waitpid((pid_t)-1, stat_loc, options);
except that on successful completion, if the r_usage argument
to wait3 is not a NULL pointer, the rusage
structure to which the third argument points is filled in for the child
process identified by the return value.
If wait3 returns because the status of a child process
is available, it returns a value equal to the process ID of the child
process for which status is reported.
If it returns due to the delivery of a signal to the calling
process, -1 is returned and errno is set to EINTR.
If waitpid was invoked with WNOHANG set in options, it has at
least one child process specified by pid for which status
is not available, and status is not available for any process specified by
pid, 0 will be returned.
Otherwise, (pid_t)-1 is returned, and errno is
set to indicate the error.
The wait3 function will fail if:
The calling process has no existing unwaited-for child processes; or,
the process or process group specified by pid does not exist
or is not a child of the calling process.
The function was interrupted by a signal.
The value of the location pointed to by stat_loc is undefined.
The options argument is not valid.
This routine conforms to X/Open System Interfaces and Headers,
Issue 4, Version 2.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004