+ ev_stop (EV_A_ (W)w);
+}
+
+void
+ev_child_start (EV_P_ struct ev_child *w)
+{
+ if (ev_is_active (w))
+ return;
+
+ ev_start (EV_A_ (W)w, 1);
+ wlist_add ((WL *)&childs [w->pid & (PID_HASHSIZE - 1)], (WL)w);
+}
+
+void
+ev_child_stop (EV_P_ struct ev_child *w)
+{
+ ev_clear_pending (EV_A_ (W)w);
+ if (ev_is_active (w))
+ return;
+
+ wlist_del ((WL *)&childs [w->pid & (PID_HASHSIZE - 1)], (WL)w);
+ ev_stop (EV_A_ (W)w);
+}
+
+/*****************************************************************************/
+
+struct ev_once
+{
+ struct ev_io io;
+ struct ev_timer to;
+ void (*cb)(int revents, void *arg);
+ void *arg;
+};
+
+static void
+once_cb (EV_P_ struct ev_once *once, int revents)
+{
+ void (*cb)(int revents, void *arg) = once->cb;
+ void *arg = once->arg;
+
+ ev_io_stop (EV_A_ &once->io);
+ ev_timer_stop (EV_A_ &once->to);
+ free (once);
+
+ cb (revents, arg);
+}
+
+static void
+once_cb_io (EV_P_ struct ev_io *w, int revents)
+{
+ once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io)), revents);
+}
+
+static void
+once_cb_to (EV_P_ struct ev_timer *w, int revents)
+{
+ once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to)), revents);
+}
+
+void
+ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg)
+{
+ struct ev_once *once = malloc (sizeof (struct ev_once));
+
+ if (!once)
+ cb (EV_ERROR | EV_READ | EV_WRITE | EV_TIMEOUT, arg);
+ else
+ {
+ once->cb = cb;
+ once->arg = arg;
+
+ ev_watcher_init (&once->io, once_cb_io);
+ if (fd >= 0)
+ {
+ ev_io_set (&once->io, fd, events);
+ ev_io_start (EV_A_ &once->io);
+ }
+
+ ev_watcher_init (&once->to, once_cb_to);
+ if (timeout >= 0.)
+ {
+ ev_timer_set (&once->to, timeout, 0.);
+ ev_timer_start (EV_A_ &once->to);
+ }
+ }