man poll: NAME poll, ppoll - wait for some event on a file descriptor SYNOPSIS #include <poll.h> int poll(struct pollfd *fds, nfds_t nfds, int timeout); #define _GNU_SOURCE /* See feature_test_macros(7) */ #include <poll.h> int ppoll(struct po
struct pollfd { int fd; //当前描述符 short events; //进程关心的该描述符的事件 short revents; //返回的事件}; asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, long timeout_msecs){ s64 timeout_jiffies; //超时时间处理 if (
一.epoll 系列函数简介 #include <sys/epoll.h> int epoll_create(int size); int epoll_create1(int flags); int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout); *