Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sh(1)

exec(2)

exit(2)

fork(2)

pause(2)

ptrace(2)

signal(5)

wait3()

NAME

wait3 − wait for child process to change state

SYNOPSIS

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

RETURN VALUE

See waitpid(). 

ERRORS

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.

SEE ALSO

exec, exit(), fork(), pause(), <sys/wait.h>. 

CHANGE HISTORY

First released in Issue 4, Version 2. 

HP−EXTENSIONS

SYNOPSIS

pid_t wait3(int *stat_loc, int options, int *reserved);

DESCRIPTION

The wait3() system call is equivalent to waitpid() with the value of pid equal to zero. The third parameter to wait3(), reserved, is currently unused and must always be a null pointer.

ERRORS

If wait3() fails, errno is set to one of the following values. 

[EINVAL] The options argument to waitpid() or wait3() is invalid. 

[EINVAL] wait3() was passed a nonnull pointer value for its third argument. 

WARNINGS

The behavior of wait3() is affected if the SIGCLD signal is set to SIG_IGN.  See the WARNINGS section of signal(5). Signal handlers that cause system calls to be restarted can affect the EINTR condition described above (see bsdproc(2),sigaction(2),and sigvector(2)). 

AUTHOR

wait3() was developed by HP, AT&T, and the University of California, Berkeley. 

SEE ALSO

Exit conditions ($?) in sh(1); exec(2), exit(2), fork(2), pause(2), ptrace(2), signal(5). 

Hewlett-Packard Company  —  HP-UX Release 10.20:  July 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026