=over =item waitpid PID,FLAGS Waits for a particular child process to terminate and returns the pid of the deceased process, or C<-1> if there is no such child process. The status is returned in C<$?>. If you say use POSIX ":sys_wait_h"; #... waitpid(-1,&WNOHANG); then you can do a non-blocking wait for any process. Non-blocking wait is available on machines supporting either the waitpid(2) or wait4(2) system calls. However, waiting for a particular pid with FLAGS of C<0> is implemented everywhere. (Perl emulates the system call by remembering the status values of processes that have exited but have not been harvested by the Perl script yet.) See L for other examples. =back