瀏覽代碼

align EPOLL_* flags with fcntl O_* flag definitions, which vary by arch

the old definitions were wrong on some archs. actually, EPOLL_NONBLOCK
probably should not even be defined; it is not accepted by the kernel
and it's not clear to me whether it has any use at all, even if it did
work. this issue should be revisited at some point, but I'm leaving it
in place for now in case some applications reference it.
Rich Felker 12 年之前
父節點
當前提交
761ebe065c
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      include/sys/epoll.h

+ 3 - 2
include/sys/epoll.h

@@ -7,13 +7,14 @@ extern "C" {
 
 #include <stdint.h>
 #include <sys/types.h>
+#include <fcntl.h>
 
 #define __NEED_sigset_t
 
 #include <bits/alltypes.h>
 
-#define EPOLL_CLOEXEC 02000000
-#define EPOLL_NONBLOCK 04000
+#define EPOLL_CLOEXEC O_CLOEXEC
+#define EPOLL_NONBLOCK O_NONBLOCK
 
 enum EPOLL_EVENTS { __EPOLL_DUMMY };
 #define EPOLLIN 0x001