diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2020-02-04 16:36:59 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2020-02-04 16:36:59 +0100 |
commit | 24d73d065ff3ae43f63db87901dcea64cc504527 (patch) | |
tree | 3775a7307f9e5d742e09ea6e5ae51d612246fcb6 /src/unix/linux-syscalls.c | |
parent | dfd64933d55fee97c329a1c13b5d6dac874e295c (diff) | |
download | libuv-24d73d065ff3ae43f63db87901dcea64cc504527.tar.gz libuv-24d73d065ff3ae43f63db87901dcea64cc504527.zip |
linux: assume the presence of inotify system calls
This lets us get rid of the system call wrappers and simplify
the fs event watcher code a great deal.
All system calls were added well before 2.6.32, our baseline kernel.
PR-URL: https://github.com/libuv/libuv/pull/2665
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'src/unix/linux-syscalls.c')
-rw-r--r-- | src/unix/linux-syscalls.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/src/unix/linux-syscalls.c b/src/unix/linux-syscalls.c index e971e82a..eb5a8fd2 100644 --- a/src/unix/linux-syscalls.c +++ b/src/unix/linux-syscalls.c @@ -34,46 +34,6 @@ # endif #endif /* __arm__ */ -#ifndef __NR_inotify_init -# if defined(__x86_64__) -# define __NR_inotify_init 253 -# elif defined(__i386__) -# define __NR_inotify_init 291 -# elif defined(__arm__) -# define __NR_inotify_init (UV_SYSCALL_BASE + 316) -# endif -#endif /* __NR_inotify_init */ - -#ifndef __NR_inotify_init1 -# if defined(__x86_64__) -# define __NR_inotify_init1 294 -# elif defined(__i386__) -# define __NR_inotify_init1 332 -# elif defined(__arm__) -# define __NR_inotify_init1 (UV_SYSCALL_BASE + 360) -# endif -#endif /* __NR_inotify_init1 */ - -#ifndef __NR_inotify_add_watch -# if defined(__x86_64__) -# define __NR_inotify_add_watch 254 -# elif defined(__i386__) -# define __NR_inotify_add_watch 292 -# elif defined(__arm__) -# define __NR_inotify_add_watch (UV_SYSCALL_BASE + 317) -# endif -#endif /* __NR_inotify_add_watch */ - -#ifndef __NR_inotify_rm_watch -# if defined(__x86_64__) -# define __NR_inotify_rm_watch 255 -# elif defined(__i386__) -# define __NR_inotify_rm_watch 293 -# elif defined(__arm__) -# define __NR_inotify_rm_watch (UV_SYSCALL_BASE + 318) -# endif -#endif /* __NR_inotify_rm_watch */ - #ifndef __NR_recvmmsg # if defined(__x86_64__) # define __NR_recvmmsg 299 @@ -167,42 +127,6 @@ #endif /* __NR_getrandom */ -int uv__inotify_init(void) { -#if defined(__NR_inotify_init) - return syscall(__NR_inotify_init); -#else - return errno = ENOSYS, -1; -#endif -} - - -int uv__inotify_init1(int flags) { -#if defined(__NR_inotify_init1) - return syscall(__NR_inotify_init1, flags); -#else - return errno = ENOSYS, -1; -#endif -} - - -int uv__inotify_add_watch(int fd, const char* path, uint32_t mask) { -#if defined(__NR_inotify_add_watch) - return syscall(__NR_inotify_add_watch, fd, path, mask); -#else - return errno = ENOSYS, -1; -#endif -} - - -int uv__inotify_rm_watch(int fd, int32_t wd) { -#if defined(__NR_inotify_rm_watch) - return syscall(__NR_inotify_rm_watch, fd, wd); -#else - return errno = ENOSYS, -1; -#endif -} - - int uv__sendmmsg(int fd, struct uv__mmsghdr* mmsg, unsigned int vlen, |