wait.h File Reference

_W_INT

Macros to test the exit status returned by wait and extract the relevant values. Convert union wait to int.

_WSTATUS

Macros to test the exit status returned by wait and extract the relevant values.

_WSTOPPED

Macros to test the exit status returned by wait and extract the relevant values.

WIFSTOPPED

Macros to test the exit status returned by wait and extract the relevant values.

WSTOPSIG

Macros to test the exit status returned by wait and extract the relevant values.

WIFSIGNALED

Macros to test the exit status returned by wait and extract the relevant values.

WTERMSIG

Macros to test the exit status returned by wait and extract the relevant values.

WIFEXITED

Macros to test the exit status returned by wait and extract the relevant values.

WEXITSTATUS

Macros to test the exit status returned by wait and extract the relevant values.

WIFCONTINUED

Macros to test the exit status returned by wait and extract the relevant values.

WIFTERMINATED

Macros to test the termination code returned by wait and extract the relevant values.

WTERMINATESTATUS

Macros to test the termination code returned by wait and extract the relevant values.

WIFPANICED

Macros to test the panic code returned by wait and extract the relevant values.

WPANICCODE

Macros to test the panic code returned by wait and extract the relevant values.

WNOHANG

Don't hang in wait.

WUNTRACED

Tell about stopped, untraced children.

WCONTINUED

Report a job control continued process.

wait ( int * )

IMPORT_C pid_twait(int *)

The wait function suspends execution of its calling process until status information is available for a terminated child process, or a signal is received. On return from a successful wait call, the status area contains termination information about the process that exited as defined below.

The wpid argument specifies the set of child processes for which to wait. If wpid is -1, the call waits for any child process. If wpid is 0, the call waits for any child process in the process group of the caller. If wpid is greater than zero, the call waits for the process with process id wpid . If wpid is less than -1, the call waits for any process whose process group id equals the absolute value of wpid .

The waitpid function is identical to wait4 with an rusage value of zero.

Note:

The waitpid function waits for a process ID which is obtained using a non-standard API popen3

See also: _exit() exit()

Parameters
Note: This description also covers the following functions - waitpid()
Return Value
If wait returns due to a stopped or terminated child process, the process ID of the child is returned to the calling process. Otherwise, a value of -1 is returned and errno is set to indicate the error. If wait4 , wait3 , or waitpid returns due to a stopped or terminated child process, the process ID of the child is returned to the calling process. If there are no children not previously awaited, -1 is returned with errno set to ECHILD . Otherwise, if WNOHANG is specified and there are no stopped or exited children, 0 is returned. If an error is detected or a caught signal aborts the call, a value of -1 is returned and errno is set to indicate the error.

waitpid ( pid_t, int *, int )

IMPORT_C pid_twaitpid(pid_t,
int *,
int
)

See also: _exit() exit()

Parameters
Refer to wait() for the documentation