Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/w/wait3.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/w/wait3.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/w/wait3.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/w/wait3.html on line 8
Wait for any child process to change its state
#include <sys/wait.h>
pid_t wait3( int * stat_loc
int options,
struct rusage * resource_usage );
- stat_loc
- NULL, or a pointer a location where the function can
store the terminating status of the child process.
For information about macros that extract information from this status, see
“Status macros”
in the documentation for wait().
- options
- A combination of zero or more of the following flags:
- WCONTINUED — return the status for any child that
was stopped and has been continued.
- WEXITED — wait for the process(es) to exit.
- WNOHANG — return immediately if there are no
children to wait for.
- WNOWAIT — keep the process in a waitable state.
This doesn't affect the state of the process; the process may be waited
for again after this call completion.
- WSTOPPED — wait for and return the process status
of any child that has stopped because it received a signal.
- WUNTRACED — report the status of a stopped child
process.
- resource_usage
- NULL, or a pointer to a rusage structure
where the function can store information about resource usage.
For information about this structure, see
getrusage().
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
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()
isn't a null pointer, the rusage structure that the third argument points to is
filled in for the child process identified by the return value.
It's also equivalent to:
wait4( (pid_t)-1, stat_loc, options, resource_usage );
If the status of a child process is available,
a value equal to the process ID of the child process for which status is reported.
If a signal is delivered to the calling process, -1 and
errno
is set to EINTR.
Zero if wait3() is invoked with WNOHANG set in options and
at least one child process is specified by pid for which status isn't available, and
status isn't available for any process specified by pid.
Otherwise, (pid_t)-1 and errno is set.
- ECHILD
- The calling process has no existing unwaited-for child processes,
or the set of processes specified by the argument pid can never
be in the states specified by the argument options.
Unix
Safety: | |
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
New applications should use
waitpid().
exit(),
fork(),
pause(),
wait4(),
waitid(),
waitpid()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/w/wait3.html on line 218
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/w/wait3.html on line 218