DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

wait3(S-osr5)


wait3 -- wait for a child process to terminate or stop

Syntax

cc . . . -lc
#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 two calls are equivalent:
   wait3(stat_loc, options, resource_usage);
   

waitpid((pid_t)-1, stat_loc, options);

The only exception is that on successful completion, if the resource_usage argument to wait3 is not a NULL pointer, the rusage structure is filled in for the child process identified by the return value (see waitpid(S-osr5)).

Return values

See waitpid(S-osr5).

Diagnostics

wait3 fails and returns immediately if one or more of the following are true:

[EINTR]
waitpid was interrupted due to the receipt of a signal sent by the calling process.

[EINVAL]
An invalid value was specified for options.

[ECHILD]
The process or process group specified by pid does not exist or is not a child of the calling process or can never be in the states specified by options, or has no unwaited-for child processes.

See also

exit(S-osr5), fork(S-osr5), siginterrupt(S-osr5), sigaction(S-osr5), signal(M), signal(S-osr5), wait(S-osr5), waitpid(S-osr5)

Standards conformance

wait3 is conformant with:

X/Open Portability Guide Issue 4, Version 2 (Spec-1170)


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005