struct epoll_event { __poll_t events; __u64 data; } EPOLL_PACKED;
data
member specifies the data that the kernel should save and return when epoll_wait
is called. struct epoll_event { uint32_t events; /* Epoll events */ epoll_data_t data; /* User data variable */ } __EPOLL_PACKED;
epoll_data_t
is defined as typedef union epoll_data { void *ptr; int fd; uint32_t u32; uint64_t u64; } epoll_data_t;
eventpoll.h
defines the following epoll event masks: EPOLLIN | The associated file is available for read(2) operations. | 0x00000001 |
EPOLLPRI | There is an exceptional condition on the file descriptor. | 0x00000002 |
EPOLLOUT | The associated file is available for write(2) operations. | 0x00000004 |
EPOLLERR | 0x00000008 | |
EPOLLHUP | Hang up happened on the associated file descriptor. | 0x00000010 |
EPOLLNVAL | 0x00000020 | |
EPOLLRDNORM | 0x00000040 | |
EPOLLRDBAND | 0x00000080 | |
EPOLLWRNORM | 0x00000100 | |
EPOLLWRBAND | 0x00000200 | |
EPOLLMSG | 0x00000400 | |
EPOLLRDHUP | … This flag is especially useful for writing simple code to detect peer shutdown when using edge-triggered monitoring. | 0x00002000 |
EPOLLET | Requests edge-triggered notification for the associated file descriptor. (The default behavior for epoll is level-triggered. | 1U << 31 |
events
member of struct epoll_event
.