+static struct ev_child *childs [PID_HASHSIZE];
+static struct ev_signal childev;
+
+#ifndef WIN32
+
+#ifndef WCONTINUED
+# define WCONTINUED 0
+#endif
+
+static void
+child_reap (struct ev_signal *sw, int chain, int pid, int status)
+{
+ struct ev_child *w;
+
+ for (w = childs [chain & (PID_HASHSIZE - 1)]; w; w = w->next)
+ if (w->pid == pid || !w->pid)
+ {
+ w->priority = sw->priority; /* need to do it *now* */
+ w->rpid = pid;
+ w->rstatus = status;
+ printf ("rpid %p %d %d\n", w, pid, w->pid);//D
+ event ((W)w, EV_CHILD);
+ }
+}
+
+static void
+childcb (struct ev_signal *sw, int revents)
+{
+ int pid, status;
+
+ printf ("chld %x\n", revents);//D
+ if (0 < (pid = waitpid (-1, &status, WNOHANG | WUNTRACED | WCONTINUED)))
+ {
+ /* make sure we are called again until all childs have been reaped */
+ event ((W)sw, EV_SIGNAL);
+
+ child_reap (sw, pid, pid, status);
+ child_reap (sw, 0, pid, status); /* this might trigger a watcher twice, but event catches that */
+ }
+}
+
+#endif
+
+/*****************************************************************************/
+
+#if EV_USE_KQUEUE
+# include "ev_kqueue.c"
+#endif
+#if EV_USE_EPOLL