[PATCH] Add support for inotify_init1() syscall.
Thierry Reding
thierry.reding at avionic-design.de
Fri Mar 5 08:14:40 UTC 2010
This patch essentially updates sys/inotify.h to the version found in glibc
2.11. Besides adding the inotify_init1() syscall this also changes the wd
parameter of inotify_rm_watch() from uint32_t to int.
inotify_init1() is required by udev 147 and later, for example.
Signed-off-by: Thierry Reding <thierry.reding at avionic-design.de>
---
libc/sysdeps/linux/common/inotify.c | 6 +++++-
libc/sysdeps/linux/common/sys/inotify.h | 17 +++++++++++++++--
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/libc/sysdeps/linux/common/inotify.c b/libc/sysdeps/linux/common/inotify.c
index e5a6120..e2f3836 100644
--- a/libc/sysdeps/linux/common/inotify.c
+++ b/libc/sysdeps/linux/common/inotify.c
@@ -15,10 +15,14 @@
_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
#ifdef __NR_inotify_rm_watch
-_syscall2(int, inotify_rm_watch, int, fd, uint32_t, wd)
+_syscall2(int, inotify_rm_watch, int, fd, int, wd)
#endif
diff --git a/libc/sysdeps/linux/common/sys/inotify.h b/libc/sysdeps/linux/common/sys/inotify.h
index 0131db9..8b3a852 100644
--- a/libc/sysdeps/linux/common/sys/inotify.h
+++ b/libc/sysdeps/linux/common/sys/inotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,6 +22,16 @@
#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,13 +89,16 @@ __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)
__THROW;
/* Remove the watch specified by WD from the inotify instance FD. */
-extern int inotify_rm_watch (int __fd, uint32_t __wd) __THROW;
+extern int inotify_rm_watch (int __fd, int __wd) __THROW;
__END_DECLS
--
tg: (c034b2e..) t/inotify (depends on: master)
More information about the uClibc
mailing list