Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 | both |
#define _XOPEN_SOURCE_EXTENDED 1
#include <sys/wait.h>
pid_t wait3(int *stat_loc, int options, struct rusage *resource_usage);
The wait3() function allows the calling process to obtain status information for specified child processes.
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 function is kept for historical reasons. It was part of the Legacy Feature in Single UNIX Specification, Version 2, but has been withdrawn and is not supported as part of Single UNIX Specification, Version 3. The waitpid() function is preferred for portability.
If it is necessary to continue using this function in an application written for Single UNIX Specification, Version 3, define the feature test macro _UNIX03_WITHDRAWN before including any standard system headers. The macro exposes all interfaces and symbols removed in Single UNIX Specification, Version 3.
See waitpid() — Wait for a specific child process to end.