--- cvsroot/EV/EV.pm 2007/11/02 20:21:33 1.23 +++ cvsroot/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 @@ -62,7 +64,7 @@ use strict; BEGIN { - our $VERSION = '0.1'; + our $VERSION = '0.5'; use XSLoader; XSLoader::load "EV", $VERSION; } @@ -199,8 +201,8 @@ Queries the priority on the watcher and optionally changes it. Pending watchers with higher priority will be invoked first. The valid range of -priorities lies between EV::MAXPRI (default 3) and EV::MINPRI (default --3). If the priority is outside this range it will automatically be +priorities lies between EV::MAXPRI (default 2) and EV::MINPRI (default +-2). If the priority is outside this range it will automatically be normalised to the nearest valid priority. The default priority of any newly-created weatcher is 0. @@ -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 @@ -466,7 +477,8 @@ warn "EV: error in callback (ignoring): $@"; }; -init; +init + or die 'EV: cannot initialise libev backend. bad $ENV{LIBEV_METHODS}?'; push @AnyEvent::REGISTRY, [EV => "EV::AnyEvent"];