#include #include #include #include #include int main (void) { int fd = inotify_init (); while (1) { int one = inotify_add_watch (fd, ".", IN_MODIFY); int two = inotify_add_watch (fd, "..", IN_MODIFY); int s; s = inotify_rm_watch (fd, one); if (s != 0) { printf ("failed to rm_watch wd %d: %s\n", one, strerror (errno)); abort (); } s = inotify_rm_watch (fd, two); if (s != 0) { printf ("failed to rm_watch wd %d: %s\n", two, strerror (errno)); abort (); } } }