int uloop_init(void)
{
+ struct timespec timeout = { 0, 0 };
+ struct kevent ev = {};
+
if (poll_fd >= 0)
return 0;
if (poll_fd < 0)
return -1;
+ EV_SET(&ev, SIGCHLD, EVFILT_SIGNAL, EV_ADD, 0, 0, 0);
+ kevent(poll_fd, &ev, 1, NULL, 0, &timeout);
+
return 0;
}