summaryrefslogtreecommitdiff
path: root/inotify-syscalls.h
diff options
context:
space:
mode:
Diffstat (limited to 'inotify-syscalls.h')
-rw-r--r--inotify-syscalls.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/inotify-syscalls.h b/inotify-syscalls.h
index a1d5408..69144cb 100644
--- a/inotify-syscalls.h
+++ b/inotify-syscalls.h
@@ -4,14 +4,15 @@
*
* Licensed under the terms of the GNU General Public License Version 2.
*
- * Copyright (c) 2006 Tobias Klauser <tklauser@distanz.ch>
+ * Copyright (c) 2006-2007 Tobias Klauser <tklauser@distanz.ch>
*/
#ifndef _LINUX_INOTIFY_SYSCALLS_H
#define _LINUX_INOTIFY_SYSCALLS_H
#include <sys/syscall.h>
-
+/* glibc already defines them for some architectures */
+#ifndef __NR_inotify_init
#if defined(__i386__)
# define __NR_inotify_init 291
# define __NR_inotify_add_watch 292
@@ -41,12 +42,6 @@
# define __NR_inotify_add_watch 152
# define __NR_inotify_rm_watch 156
#elif defined (__arm__)
-# define __NR_OABI_SYSCALL_BASE 0x900000
-# if defined(__thumb__) || defined(__ARM_EABI__)
-# define __NR_SYSCALL_BASE 0
-# else
-# define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
-# endif
# define __NR_inotify_init (__NR_SYSCALL_BASE + 316)
# define __NR_inotify_add_watch (__NR_SYSCALL_BASE + 317)
# define __NR_inotify_rm_watch (__NR_SYSCALL_BASE + 318)
@@ -54,6 +49,10 @@
# define __NR_inotify_init 290
# define __NR_inotify_add_watch 291
# define __NR_inotify_rm_watch 292
+#elif defined (__m32r__)
+# define __NR_inotify_init 290
+# define __NR_inotify_add_watch 291
+# define __NR_inotify_rm_watch 292
#elif defined (__hppa__)
# define __NR_inotify_init 269
# define __NR_inotify_add_watch 270
@@ -76,23 +75,28 @@
# define __NR_inotify_add_watch (__NR_Linux + 248)
# define __NR_inotify_rm_watch (__NR_Linux + 249)
# endif
+#elif defined (__m68k__)
+# define __NR_inotify_init 284
+# define __NR_inotify_add_watch 285
+# define __NR_inotify_rm_watch 286
#else
# error "inotify not supported on this architecture!"
#endif
+#endif /* __NR_inotify_init */
-static inline int inotify_init (void)
+static inline int inotify_init(void)
{
- return syscall (__NR_inotify_init);
+ return syscall(__NR_inotify_init);
}
-static inline int inotify_add_watch (int fd, const char *name, __u32 mask)
+static inline int inotify_add_watch(int fd, const char *name, __u32 mask)
{
- return syscall (__NR_inotify_add_watch, fd, name, mask);
+ return syscall(__NR_inotify_add_watch, fd, name, mask);
}
-static inline int inotify_rm_watch (int fd, __u32 wd)
+static inline int inotify_rm_watch(int fd, __u32 wd)
{
- return syscall (__NR_inotify_rm_watch, fd, wd);
+ return syscall(__NR_inotify_rm_watch, fd, wd);
}
#endif /* _LINUX_INOTIFY_SYSCALLS_H */