Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation


by gods
on Aug 24, 1999 at 22:43 UTC ( #355=perlfunc: print w/ replies, xml ) Need Help??


See the current Perl documentation for waitpid.

Here is our local, out-dated (pre-5.6) version:

waitpid - wait for a particular child process to die

waitpid PID,FLAGS

Waits for a particular child process to terminate and returns the pid of the deceased process, or -1 if there is no such child process. The status is returned in $?. If you say

    use POSIX ":sys_wait_h";

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 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 the perlipc manpage for other examples.

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2015-10-05 02:09 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (106 votes), past polls