Handling of asynchronous events---reference
|
There are many problems with this interface. It can only watch directories. If one wants to watch many directories,it takes many file descriptors. Moreover,the open file pins the filesystem so that it cannot be unmounted. When something happens it is unknown what,and a? 12.7?inotify(Since 2.6.13.) Inotify is implemented using three new system calls and the usual? int inotify_init(void); int inotify_add_watch (int fd,const char *pathname,int mask); int inotify_rm_watch (int fd,int wd); The first returns a file descriptor:? An inotify_event is defined by struct inotify_event {
int wd; /* Watch descriptor */
uint32_t mask; /* Mask of events */
uint32_t cookie; /* Unique cookie associating related
events (for rename(2)) */
uint32_t len; /* Size of 'name' field */
char name[]; /* Optional null-terminated name */
};
The? There is a? % ls /proc/sys/fs/inotify/ max_queued_events max_user_instances max_user_watches % cat $_/* 16384 128 8192 Applications are?,??and?. /* inotify demo,mimicking the above dnotify one */ #include (编辑:ASP站长) 【免责声明】本站内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。 |
-
无相关信息


