1、相关的头文件:<sys/epoll.h>
2、epoll涉及到的数据结构
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 */
};
3、函数及相关参数说明
epoll_create(int size) 生成一个epoll虚拟描述符
Since Linux 2.6.8, the size argument is unused. (The kernel dynamically sizes the required data structures without needing this initial hint.)
参考地址:http://www.kernel.org/doc/man-pages/online/pages/man2/epoll_create.2.html