[Chapter 3] 3.2.190 waitpid
Author: Larry Wall, Tom Christiansen & Randal L. Schwartz
Date: 1999-07-02T01:56:36Z

#

| Chapter 3 Functions |

### 3.2.190 waitpid

    waitpid PID, FLAGS

This function waits for a particular child process to terminate and returns the pid when the process is dead, or -1 if there are no child processes, or 0 if the `FLAGS` specify non-blocking and the process isn't dead yet. The status of the dead process is returned in $?. To get valid flag values say this:

    use POSIX "sys_wait_h";

On systems that implement neither the waitpid(2) nor wait4(2) system call, `FLAGS` may be specified only as 0. In other words, you can wait for a specific `PID`, but you can't do it in non-blocking mode.

3.2.189 wait |  | 3.2.191 wantarray