1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef _UAPI_LINUX_EVENTPOLL_H 7 #define _UAPI_LINUX_EVENTPOLL_H 8 #include <linux/fcntl.h> 9 #include <linux/types.h> 10 #define EPOLL_CLOEXEC O_CLOEXEC 11 #define EPOLL_CTL_ADD 1 12 #define EPOLL_CTL_DEL 2 13 #define EPOLL_CTL_MOD 3 14 #define EPOLLIN (__force __poll_t)0x00000001 15 #define EPOLLPRI (__force __poll_t)0x00000002 16 #define EPOLLOUT (__force __poll_t)0x00000004 17 #define EPOLLERR (__force __poll_t)0x00000008 18 #define EPOLLHUP (__force __poll_t)0x00000010 19 #define EPOLLNVAL (__force __poll_t)0x00000020 20 #define EPOLLRDNORM (__force __poll_t)0x00000040 21 #define EPOLLRDBAND (__force __poll_t)0x00000080 22 #define EPOLLWRNORM (__force __poll_t)0x00000100 23 #define EPOLLWRBAND (__force __poll_t)0x00000200 24 #define EPOLLMSG (__force __poll_t)0x00000400 25 #define EPOLLRDHUP (__force __poll_t)0x00002000 26 #define EPOLLEXCLUSIVE ((__force __poll_t)(1U << 28)) 27 #define EPOLLWAKEUP ((__force __poll_t)(1U << 29)) 28 #define EPOLLONESHOT ((__force __poll_t)(1U << 30)) 29 #define EPOLLET ((__force __poll_t)(1U << 31)) 30 #ifdef __x86_64__ 31 #define EPOLL_PACKED __attribute__((packed)) 32 #else 33 #define EPOLL_PACKED 34 #endif 35 struct epoll_event { 36 __poll_t events; 37 __u64 data; 38 } EPOLL_PACKED; 39 #ifdef CONFIG_PM_SLEEP ep_take_care_of_epollwakeup(struct epoll_event * epev)40static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) 41 { 42 if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND)) 43 epev->events &= ~EPOLLWAKEUP; 44 } 45 #else ep_take_care_of_epollwakeup(struct epoll_event * epev)46static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev) 47 { 48 epev->events &= ~EPOLLWAKEUP; 49 } 50 #endif 51 #endif 52