https://linux.die.net/man/2/epoll_ctl:
EPOLLONESHOT (since Linux 2.6.2)
Sets the one-shot behavior for the associated file descriptor.
This means that after an event is pulled out with epoll_wait(2)
the associated file descriptor is internally disabled and
no other events will be reported by the epoll interface.
The user must call epoll_ctl() with EPOLL_CTL_MOD to
rearm the file descriptor with a new event mask.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6c0dc93e1cdae0e8cea5b487c7005de2da2c2ec3
Linux Programmer's Manual
NAME
epoll_create, epoll_create1 - open an epoll file descriptor
...
SYNOPSIS
#include <sys/epoll.h>
int epoll_create1(int flags);
...
epoll_create1()
If flags is 0, then, other than the fact that the obsolete
size argument is dropped, epoll_create1() is the same as
epoll_create(). The following value can be included in flags
to obtain different behavior:
EPOLL_CLOEXEC
Set the close-on-exec (FD_CLOEXEC) flag on the new file
descriptor. See the description of the O_CLOEXEC flag in
open(2) for reasons why this may be useful.
https://man7.org/linux/man-pages/man7/epoll.7.html
sync the struct epoll_event define with linux:
Linux Programmer's Manual:
DESCRIPTION
EPOLL_CTL_DEL
...
The event argument describes the object linked to the file descriptor
fd. The struct epoll_event is defined as:
typedef union epoll_data {
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
struct epoll_event {
uint32_t events; /* Epoll events */
epoll_data_t data; /* User data variable */
};
https: //man7.org/linux/man-pages/man2/epoll_ctl.2.html
Change-Id: I3ad447b485fd331190e461a198ef7c39301eb1bb
Signed-off-by: chao.an <anchao@xiaomi.com>