add blobmsg_name()
[project/libubox.git] / uloop.h
diff --git a/uloop.h b/uloop.h
index f84050a..10a117f 100644 (file)
--- a/uloop.h
+++ b/uloop.h
 
 #include <sys/time.h>
 #include <stdbool.h>
+#include <stdint.h>
+
+#if defined(__APPLE__) || defined(__FreeBSD__)
+#define USE_KQUEUE
+#else
+#define USE_EPOLL
+#endif
 
 struct uloop_fd;
 struct uloop_timeout;
@@ -32,6 +39,7 @@ typedef void (*uloop_timeout_handler)(struct uloop_timeout *t);
 #define ULOOP_READ             (1 << 0)
 #define ULOOP_WRITE            (1 << 1)
 #define ULOOP_EDGE_TRIGGER     (1 << 2)
+#define ULOOP_BLOCKING         (1 << 3)
 
 struct uloop_fd
 {
@@ -40,6 +48,9 @@ struct uloop_fd
        bool eof;
        bool error;
        bool registered;
+#ifdef USE_KQUEUE
+       uint8_t kqflags;
+#endif
 };
 
 struct uloop_timeout