It is meant to replace the older POSIX select(2) and poll(2) system calls, to achieve better performance in more demanding applications, where the number of watched file descriptors is large (unlike the older system calls, which operate in O(n) time, epoll operates in O(1) time).
[2] epoll is similar to FreeBSD's kqueue, in that it consists of a set of user-space functions, each taking a file descriptor argument denoting the configurable kernel object, against which they cooperatively operate.
epoll uses a red–black tree (RB-tree) data structure to keep track of all file descriptors that are currently being monitored.
In level-triggered mode, further calls to epoll_wait will return immediately, as long as the pipe's buffer contains data to be read.
EPOLLONESHOT was added in version 2.6.2 of the Linux kernel mainline, released in February 2004.