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:
is equivalent to the call:wait3(stat_loc, options, resource_usage);
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.waitpid((pid_t)-1, stat_loc, options);
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:
- [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.
- [ENOSYS]
- The wait3() function is not supported on this implementation.
None.
New applications should use waitpid().
None.
exec, exit(), fork(), pause(), waitpid(), <sys/wait.h>.