HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)
w
wait3(2) wait3(2)
NAME
wait3 - wait for child process to change state
SYNOPSIS
#include <sys/wait.h>
pid_t wait3 (int *stat_loc, int options,
struct rusage *resource_usage);
DESCRIPTION
The wait3() function allows the calling process to obtain status information for specified child processes.
The following call:
wait3(stat_loc, options, resource_usage);
is equivalent to the call:
waitpid((pid_t)-1, stat_loc, options);
except that on successful completion, if the resource_usage argument to
wait3() is not a null pointer, the
rusage structure that the third argument points to is filled in for the child process identified by the
return value.
RETURN VALUE
See wait(2).
ERRORS
In addition to the error conditions specified on waitpid() , under the following conditions,
wait3()
may fail and set errno to:
[ECHILD] The calling process has no existing unwaited-for child processes, or if the set of
processes specified by the argument pid can never be in the states specified by the
argument options.
APPLICATION USAGE
Threads Considerations
In a multi-threaded application, only the calling thread is suspended by
wait3().
wait3() will not return until all threads in the process have reached the desired state. For example,
wait3() will not return until all threads have terminated. If the WUNTRACED or WCONTINUED options
are specified,
wait3() will not return until all threads have stopped or continued respectively.
SEE ALSO
exec(2), exit(2), fork(2), pause(2), <sys/wait.h>.
CHANGE HISTORY
First released in Issue 4, Version 2.
Section 2−−476 Hewlett-Packard Company − 1 − HP-UX 11i Version 1: September 2005