Browse Source

inotify_init: Use inotify_init1 if inotify_init syscall is not defined

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Markos Chandras 11 years ago
parent
commit
af63ec925e
2 changed files with 9 additions and 1 deletions
  1. 7 0
      libc/sysdeps/linux/common/inotify.c
  2. 2 1
      libc/sysdeps/linux/common/stubs.c

+ 7 - 0
libc/sysdeps/linux/common/inotify.c

@@ -19,6 +19,13 @@ _syscall0(int, inotify_init)
 _syscall1(int, inotify_init1, int, flags)
 #endif
 
+#if defined __NR_inotify_init1 && !defined __NR_inotify_init
+int inotify_init(void)
+{
+	return INLINE_SYSCALL(inotify_init1, 1, 0);
+}
+#endif
+
 #ifdef __NR_inotify_add_watch
 _syscall3(int, inotify_add_watch, int, fd, const char *, path, uint32_t, mask)
 #endif

+ 2 - 1
libc/sysdeps/linux/common/stubs.c

@@ -176,7 +176,8 @@ make_stub(init_module)
 make_stub(inotify_add_watch)
 #endif
 
-#if !defined __NR_inotify_init && defined __UCLIBC_LINUX_SPECIFIC__
+#if !defined __NR_inotify_init && defined __UCLIBC_LINUX_SPECIFIC__ \
+		&& !defined __NR_inotify_init1
 make_stub(inotify_init)
 #endif