Skip to the content.

Home / cs-notes / Operating System / Linux / Syscalls / epoll / methods

int epoll_create(int size)

int epoll_ctl(int epfd int op int fd struct epoll_event *event)

typedef union epoll_data {
    void *ptr; /* 指向用户自定义数据 */
    int fd; /* 注册的文件描述符 */
    uint32_t u32; /* 32-bit integer */
    uint64_t u64; /* 64-bit integer */
} epoll_data_t;

struct epoll_event {
    uint32_t events; /* 描述epoll事件 */
    epoll_data_t data; /* 见上面的结构体 */
};

int epoll_wait(int epfd struct epoll_event *events int maxevents int timeout)