The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


wait3 - wait for a child process to change state (LEGACY)


#include <sys/wait.h>

pid_t wait3 (int *stat_loc, int options, struct rusage *resource_usage);


The wait3() function allows the calling thread 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.

This interface need not be reentrant.


See waitpid().


In addition to the error conditions specified on waitpid(), under the following conditions, wait3() may fail and set errno to:
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.
The wait3() function is not supported on this implementation.




New applications should use waitpid().




exec, exit(), fork(), pause(), waitpid(), <sys/wait.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]