DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

wait3(S)


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)).

Return values

See waitpid(S).

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), fork(S), siginterrupt(S), sigaction(S), signal(M), signal(S), wait(S), waitpid(S)

Standards conformance

wait3 is conformant with:

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


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003