struct ev_child
{
mixin EV_WATCHER_LIST!(ev_child);
+ int flags; // private
int pid; // ro
int rpid; // rw, holds the received pid
int rstatus; // rw, holds the exit status, use the
// set the callback function to call on a
// retryable syscall error
// (such as failed select, poll, epoll_wait)
-void ev_set_syserr_cb(void* function(char* msg));
+void ev_set_syserr_cb(void function(char* msg));
extern ev_loop_t* ev_default_loop_ptr;
bool ev_is_pending(TYPE)(TYPE* w)
{
- return w.pending;
+ return cast (bool) w.pending;
}
bool ev_is_active(TYPE)(TYPE* w)
{
- return w.active;
+ return cast (bool) w.active;
}
int ev_priority(TYPE)(TYPE* w)
{
- return w.priority;
+ return cast (bool) w.priority;
}
void function(ev_loop_t*, TYPE*, int) ev_cb(TYPE)(TYPE* w)
w.signum = signum;
}
-void ev_child_set(ev_child* w, int pid)
+void ev_child_set(ev_child* w, int pid, int trace)
{
w.pid = pid;
+ w.flags = !!trace;
}
void ev_stat_set(ev_stat* w, char* path, ev_tstamp interval)
}
void ev_child_init(ev_child* w, void function(ev_loop_t*, ev_child*, int) cb,
- int pid)
+ int pid, int trace)
{
ev_init(w, cb);
- ev_child_set(w, pid);
+ ev_child_set(w, pid, trace);
}
void ev_stat_init(ev_stat* w, void function(ev_loop_t*, ev_stat*, int) cb,
wsignal.data = &epipe[1]; // write fd
ev_signal_start(loop, &wsignal);
- ev_child_init(&wchild, &cbchild, 0 /* trace any PID */);
+ ev_child_init(&wchild, &cbchild, 0 /* trace any PID */, 0 /* death */);
ev_child_start(loop, &wchild);
ev_stat_init(&wstat, &cbstat, str.toStringz(STAT_FILE), 0 /* auto */);