從kernel.org聯的,在所述的http://man7.org/linux/man-pages/man2/epoll_ctl.2.html手冊頁,聲明epoll_ctl過程如下: int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
可以明顯看出,所述event參數被聲明爲指向struct epoll_eve
我很少知道epoll,檢查一些文件,然後想後,運行這樣的: while(true){
epoll_wait(some_sock_fds);
foreach(usable_fds){
handler(one_fd); <----- this function must be non-blocking ?
}
}
在handler功能應該有一些關於網絡的
epoll_insert功能被sys_epoll_ctl調用。 有在epoll_insert功能的一些關鍵步驟: 使用隊列回調初始化調查表:ep_ptable_queue_proc 而且它會調用file->f_op->poll 如果該文件是已經「準備就緒」,然後我們將其放入就緒列表中 /* If the file is already "ready" we drop it inside the r