This source file includes following definitions.
- ep_take_care_of_epollwakeup
- ep_take_care_of_epollwakeup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef _UAPI_LINUX_EVENTPOLL_H
16 #define _UAPI_LINUX_EVENTPOLL_H
17
18
19 #include <linux/fcntl.h>
20 #include <linux/types.h>
21
22
23 #define EPOLL_CLOEXEC O_CLOEXEC
24
25
26 #define EPOLL_CTL_ADD 1
27 #define EPOLL_CTL_DEL 2
28 #define EPOLL_CTL_MOD 3
29
30
31 #define EPOLLIN (__force __poll_t)0x00000001
32 #define EPOLLPRI (__force __poll_t)0x00000002
33 #define EPOLLOUT (__force __poll_t)0x00000004
34 #define EPOLLERR (__force __poll_t)0x00000008
35 #define EPOLLHUP (__force __poll_t)0x00000010
36 #define EPOLLNVAL (__force __poll_t)0x00000020
37 #define EPOLLRDNORM (__force __poll_t)0x00000040
38 #define EPOLLRDBAND (__force __poll_t)0x00000080
39 #define EPOLLWRNORM (__force __poll_t)0x00000100
40 #define EPOLLWRBAND (__force __poll_t)0x00000200
41 #define EPOLLMSG (__force __poll_t)0x00000400
42 #define EPOLLRDHUP (__force __poll_t)0x00002000
43
44
45 #define EPOLLEXCLUSIVE ((__force __poll_t)(1U << 28))
46
47
48
49
50
51
52
53
54
55
56
57 #define EPOLLWAKEUP ((__force __poll_t)(1U << 29))
58
59
60 #define EPOLLONESHOT ((__force __poll_t)(1U << 30))
61
62
63 #define EPOLLET ((__force __poll_t)(1U << 31))
64
65
66
67
68
69
70
71 #ifdef __x86_64__
72 #define EPOLL_PACKED __attribute__((packed))
73 #else
74 #define EPOLL_PACKED
75 #endif
76
77 struct epoll_event {
78 __poll_t events;
79 __u64 data;
80 } EPOLL_PACKED;
81
82 #ifdef CONFIG_PM_SLEEP
83 static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
84 {
85 if ((epev->events & EPOLLWAKEUP) && !capable(CAP_BLOCK_SUSPEND))
86 epev->events &= ~EPOLLWAKEUP;
87 }
88 #else
89 static inline void ep_take_care_of_epollwakeup(struct epoll_event *epev)
90 {
91 epev->events &= ~EPOLLWAKEUP;
92 }
93 #endif
94 #endif