--- cvsroot/EV/EV.xs 2007/11/02 23:22:17 1.44 +++ cvsroot/EV/EV.xs 2007/11/04 16:43:53 1.49 @@ -10,6 +10,11 @@ #include "libev/ev.c" #include "libev/event.h" #include "libev/event.c" +#define DNS_USE_GETTIMEOFDAY_FOR_ID 1 +#define HAVE_STRUCT_IN6_ADDR 1 +#undef HAVE_STRTOK_R +#undef strtok_r +#define strtok_r fake_strtok_r #include "libev/evdns.c" typedef int Signal; @@ -140,9 +145,6 @@ 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; @@ -287,9 +289,9 @@ evapi.rev = EV_API_REVISION; evapi.sv_fileno = sv_fileno; evapi.sv_signum = sv_signum; - evapi.now = &ev_now; - evapi.method = &ev_method; - evapi.loop_done = &ev_loop_done; + evapi.now = ev_now; + evapi.method = ev_method; + evapi.unloop = ev_unloop; evapi.time = ev_time; evapi.loop = ev_loop; evapi.once = ev_once; @@ -315,20 +317,12 @@ SvREADONLY_on (sv); } - pthread_atfork (ev_fork_prepare, ev_fork_parent, ev_fork_child); + pthread_atfork (0, 0, ev_default_fork); } NV ev_now () - CODE: - RETVAL = ev_now; - OUTPUT: - RETVAL int ev_method () - CODE: - RETVAL = ev_method; - OUTPUT: - RETVAL NV ev_time () @@ -336,9 +330,7 @@ void ev_loop (int flags = 0) -void ev_loop_done (int value = 1) - CODE: - ev_loop_done = value; +void ev_unloop (int how = 1) struct ev_io *io (SV *fh, int events, SV *cb) ALIAS: @@ -424,7 +416,7 @@ ALIAS: check_ns = 1 CODE: - RETVAL = e_new (sizeof (struct ev_check), cb); + RETVAL = e_new (sizeof (struct ev_child), cb); ev_child_set (RETVAL, pid); if (!ix) ev_child_start (RETVAL); OUTPUT: @@ -721,9 +713,11 @@ RETVAL -int status (struct ev_child *w) +int rstatus (struct ev_child *w) + ALIAS: + rpid = 1 CODE: - RETVAL = w->status; + RETVAL = ix ? w->rpid : w->rstatus; OUTPUT: RETVAL