WAIT(2) HP Integral PC WAIT(2) WAIT(2) HP Integral PC WAIT(2) WAIT(2) HP Integral PC WAIT(2) WAIT(2) HP Integral PC WAIT(2) NAME NAME NAME NAME wait - wait for child process to stop or terminate SYNOPSIS SYNOPSIS SYNOPSIS SYNOPSIS int wait (stat_loc) int *stat_loc; int wait ((int *)0) DESCRIPTION DESCRIPTION DESCRIPTION DESCRIPTION Wait suspends the calling process until it receives a signal that is to be caught (see signal (2)), or until any one of the calling process's child processes stops in a trace mode (see ptrace (2)) or terminates. If a child process stopped or terminated prior to the call on wait , return is immediate. If stat_loc (taken as an integer) is non-zero, 16 bits of information called status are stored in the low order 16 bits of the location pointed to by stat_loc . Status can be used to differentiate between stopped and terminated child processes and if the child process terminated, status identifies the cause of termination and pass useful information to the parent. This is accomplished in the following manner: If the child process stopped, the high order 8 bits of status will be zero and the low order 8 bits will be set equal to 0177. If the child process terminated due to an exit call, the low order 8 bits of status will be zero and the high order 8 bits will contain the low order 8 bits of the argument that the child process passed to exit ; see exit (2). If the child process terminated due to a signal, the high order 8 bits of status will be zero and the low order 8 bits will contain the number of the signal that caused the termination. In addition, if the low order seventh bit (i.e., bit 200) is set, a ``core image'' will have been produced; see signal (2). If a parent process terminates without waiting for its child processes to terminate, the parent process ID of each child process is set to 1. This means the initialization process inherits the child processes; see intro (2). Wait will fail and return immediately if one or more of the following are true: The calling process has no existing unwaited-for child Hewlett-Packard - 1 - (printed 12/12/84) WAIT(2) HP Integral PC WAIT(2) WAIT(2) HP Integral PC WAIT(2) WAIT(2) HP Integral PC WAIT(2) WAIT(2) HP Integral PC WAIT(2) processes. [ECHILD] Stat_loc points to an illegal address. [EFAULT] RETURN VALUE RETURN VALUE RETURN VALUE RETURN VALUE If wait returns due to the receipt of a signal, a value of -1 is returned to the calling process and errno is set to EINTR. 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. SEE ALSO SEE ALSO SEE ALSO SEE ALSO exec(2), exit(2), fork(2), pause(2), signal(2). WARNING WARNING WARNING WARNING See WARNING in signal (2). The HP Integral PC does not create core files. Hewlett-Packard - 2 - (printed 12/12/84)