--- EV/EV.xs 2007/10/31 19:07:43 1.23 +++ EV/EV.xs 2007/10/31 20:10:17 1.24 @@ -106,7 +106,7 @@ { dSP; I32 mark = SP - PL_stack_base; - SV *sv_self, *sv_events; + SV *sv_self, *sv_events, *sv_status = 0; static SV *sv_events_cache; sv_self = newRV_inc (w->self); /* w->self MUST be blessed by now */ @@ -123,11 +123,16 @@ EXTEND (SP, 2); PUSHs (sv_self); PUSHs (sv_events); + + if (revents & EV_CHILD) + XPUSHs (sv_status = newSViv (((struct ev_child *)w)->status)); + PUTBACK; call_sv (w->cb_sv, G_DISCARD | G_VOID | G_EVAL); SP = PL_stack_base + mark; PUTBACK; SvREFCNT_dec (sv_self); + SvREFCNT_dec (sv_status); if (sv_events_cache) SvREFCNT_dec (sv_events); @@ -279,6 +284,8 @@ evapi.prepare_stop = evprepare_stop; evapi.check_start = evcheck_start; evapi.check_stop = evcheck_stop; + evapi.child_start = evchild_start; + evapi.child_stop = evchild_stop; sv_setiv (sv, (IV)&evapi); SvREADONLY_on (sv); @@ -387,7 +394,7 @@ check_ns = 1 CODE: RETVAL = e_new (sizeof (struct ev_check), cb); - evchild (RETVAL, pid); + evchild_set (RETVAL, pid); if (!ix) evchild_start (RETVAL); OUTPUT: RETVAL @@ -559,6 +566,12 @@ if (active) evchild_start (w); } +int status (struct ev_child *w) + CODE: + RETVAL = w->status; + OUTPUT: + RETVAL + #if 0 MODULE = EV PACKAGE = EV::DNS PREFIX = evdns_