inotify_add_watch(2) System Calls Manual inotify_add_watch(2) inotify_add_watch - inotify LIBRARY Standard C library (libc, -lc) #include int inotify_add_watch(int fd, const char *pathname, uint32_t mask); inotify_add_watch() (watch) , , pathname; . fd , inotify, . pathname mask. mask inotify(7). inotify_add_watch() inotify, (), pathname. inotify, . (, ), . read(2) inotify. inotify_event (. inotify(7)), ; , . On success, inotify_add_watch() returns a watch descriptor (a nonnegative integer). On error, -1 is returned and errno is set to indicate the error. EACCES . EBADF . EEXIST mask IN_MASK_CREATE pathname , fd. EFAULT pathname . EINVAL ; mask IN_MASK_ADD IN_MASK_CREATE ; fd inotify. ENAMETOOLONG pathname. ENOENT pathname . ENOMEM . ENOSPC inotify . ENOTDIR mask IN_ONLYDIR pathname . Linux. Linux 2.6.13. inotify(7). . inotify_init(2), inotify_rm_watch(2), inotify(7) Azamat Hackimov , Dmitriy S. Seregin , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . inotify_add_watch(2)