--- EV/EV.pm 2007/11/02 23:22:17 1.26 +++ EV/EV.pm 2007/11/03 09:19:58 1.27 @@ -42,7 +42,9 @@ # CHILD/PID STATUS CHANGES my $w = EV::child 666, sub { - my ($w, $revents, $status) = @_; + my ($w, $revents) = @_; + # my $pid = $w->rpid; + my $status = $w->rstatus; }; # MAINLOOP @@ -358,9 +360,8 @@ receives a SIGCHLD, EV will fetch the outstanding exit/wait status for all changed/zombie children and call the callback. -Unlike all other callbacks, this callback will be called with an -additional third argument which is the exit status. See the C -function for details. +You can access both status and pid by using the C and C +methods on the watcher object. You can have as many pid watchers per pid as you want. @@ -377,6 +378,16 @@ Returns the previously set process id and optionally set a new one. +=item $exit_status = $w->rstatus + +Return the exit/wait status (as returned by waitpid, see the waitpid entry +in perlfunc). + +=item $pid = $w->rpid + +Return the pid of the awaited child (useful when you have installed a +watcher for all pids). + =item $w = EV::idle $callback