我想知道inotify和epoll两种I/O观察器的区别是什么?
inotify:
这个理解正确吗?其他有什么不同之处?
- inotify_init(void) 创建一个inotify实例以读取事件
- inotify_add_watch(int fd, const char * path, int mask) 返回围绕路径的文件节点的监视fd
- inotify_rm_watch(int fd, int wd) 停止在fd上观察事件
- epoll_create(void) 创建epoll对象
- epoll_ctl(int epfd, int op, int fd, struct epoll_event * event) 设置要观察的事件
- epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout); 阻塞,直到事件发生
这个理解正确吗?其他有什么不同之处?