fix errno for posix_openpt with no free ptys available
[musl.git] / src / linux / inotify.c
blobdf5e48b31b7eadee73b5f9fd9d6612555ae71338
1 #include <sys/inotify.h>
2 #include <errno.h>
3 #include "syscall.h"
5 int inotify_init()
7 return inotify_init1(0);
9 int inotify_init1(int flags)
11 int r = __syscall(SYS_inotify_init1, flags);
12 #ifdef SYS_inotify_init
13 if (r==-ENOSYS && !flags) r = __syscall(SYS_inotify_init);
14 #endif
15 return __syscall_ret(r);
18 int inotify_add_watch(int fd, const char *pathname, uint32_t mask)
20 return syscall(SYS_inotify_add_watch, fd, pathname, mask);
23 int inotify_rm_watch(int fd, int wd)
25 return syscall(SYS_inotify_rm_watch, fd, wd);