OSDN Git Service

inotify: add inotify_init1 system call support
authorVladimir Zapolskiy <vzapolskiy@gmail.com>
Tue, 1 Jun 2010 16:02:54 +0000 (20:02 +0400)
committerKhem Raj <raj.khem@gmail.com>
Tue, 1 Jun 2010 19:39:18 +0000 (12:39 -0700)
This patch introduces support for inotify_init1 system call, found
since Linux 2.6.27.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
libc/sysdeps/linux/common/inotify.c
libc/sysdeps/linux/common/sys/inotify.h

index e5a6120..e35f043 100644 (file)
 _syscall0(int, inotify_init)
 #endif
 
+#ifdef __NR_inotify_init1
+_syscall1(int, inotify_init1, int, flags)
+#endif
+
 #ifdef __NR_inotify_add_watch
 _syscall3(int, inotify_add_watch, int, fd, const char *, path, uint32_t, mask)
 #endif
index 0131db9..dc4e19d 100644 (file)
 #include <stdint.h>
 
 
+/* Flags for the parameter of inotify_init1.  */
+enum
+  {
+    IN_CLOEXEC = 02000000,
+#define IN_CLOEXEC IN_CLOEXEC
+    IN_NONBLOCK = 04000
+#define IN_NONBLOCK IN_NONBLOCK
+  };
+
+
 /* Structure describing an inotify event.  */
 struct inotify_event
 {
@@ -79,6 +89,9 @@ __BEGIN_DECLS
 /* Create and initialize inotify instance.  */
 extern int inotify_init (void) __THROW;
 
+/* Create and initialize inotify instance.  */
+extern int inotify_init1 (int __flags) __THROW;
+
 /* Add watch of object NAME to inotify instance FD.  Notify about
    events specified by MASK.  */
 extern int inotify_add_watch (int __fd, const char *__name, uint32_t __mask)