1 |
root |
1.1 |
#ifndef _LINUX_INOTIFY_SYSCALLS_H |
2 |
|
|
#define _LINUX_INOTIFY_SYSCALLS_H |
3 |
|
|
|
4 |
root |
1.2 |
/* |
5 |
|
|
* This file originally came from |
6 |
|
|
* http://kernel.org/pub/linux/kernel/people/rml/inotify/headers/ |
7 |
|
|
* courtesy of Robert Love. |
8 |
|
|
* But it has been modified since then. |
9 |
|
|
*/ |
10 |
|
|
|
11 |
root |
1.1 |
#include <sys/syscall.h> |
12 |
root |
1.2 |
#include <unistd.h> |
13 |
|
|
|
14 |
|
|
#if defined (__alpha__) |
15 |
|
|
# define __NR_inotify_init 444 |
16 |
|
|
# define __NR_inotify_add_watch 445 |
17 |
|
|
# define __NR_inotify_rm_watch 446 |
18 |
|
|
|
19 |
|
|
#elif defined (__arm__) |
20 |
|
|
# define __NR_inotify_init (__NR_SYSCALL_BASE+316) |
21 |
|
|
# define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317) |
22 |
|
|
# define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318) |
23 |
|
|
|
24 |
|
|
#elif defined (__frv__) |
25 |
|
|
# define __NR_inotify_init 291 |
26 |
|
|
# define __NR_inotify_add_watch 292 |
27 |
|
|
# define __NR_inotify_rm_watch 293 |
28 |
|
|
|
29 |
|
|
#elif defined(__i386__) |
30 |
|
|
# define __NR_inotify_init 291 |
31 |
|
|
# define __NR_inotify_add_watch 292 |
32 |
|
|
# define __NR_inotify_rm_watch 293 |
33 |
|
|
|
34 |
|
|
#elif defined (__ia64__) |
35 |
|
|
# define __NR_inotify_init 1277 |
36 |
|
|
# define __NR_inotify_add_watch 1278 |
37 |
|
|
# define __NR_inotify_rm_watch 1279 |
38 |
|
|
|
39 |
|
|
#elif defined (__mips__) |
40 |
|
|
# if _MIPS_SIM == _MIPS_SIM_ABI32 |
41 |
|
|
# define __NR_inotify_init (__NR_Linux + 284) |
42 |
|
|
# define __NR_inotify_add_watch (__NR_Linux + 285) |
43 |
|
|
# define __NR_inotify_rm_watch (__NR_Linux + 286) |
44 |
|
|
# endif |
45 |
|
|
# if _MIPS_SIM == _MIPS_SIM_ABI64 |
46 |
|
|
# define __NR_inotify_init (__NR_Linux + 243) |
47 |
|
|
# define __NR_inotify_add_watch (__NR_Linux + 243) |
48 |
|
|
# define __NR_inotify_rm_watch (__NR_Linux + 243) |
49 |
|
|
# endif |
50 |
|
|
# if _MIPS_SIM == _MIPS_SIM_NABI32 |
51 |
|
|
# define __NR_inotify_init (__NR_Linux + 247) |
52 |
|
|
# define __NR_inotify_add_watch (__NR_Linux + 248) |
53 |
|
|
# define __NR_inotify_rm_watch (__NR_Linux + 249) |
54 |
|
|
# endif |
55 |
|
|
|
56 |
|
|
#elif defined(__parisc__) |
57 |
|
|
# define __NR_inotify_init (__NR_Linux + 269) |
58 |
|
|
# define __NR_inotify_add_watch (__NR_Linux + 270) |
59 |
|
|
# define __NR_inotify_rm_watch (__NR_Linux + 271) |
60 |
root |
1.1 |
|
61 |
|
|
#elif defined(__powerpc__) || defined(__powerpc64__) |
62 |
root |
1.2 |
# define __NR_inotify_init 275 |
63 |
|
|
# define __NR_inotify_add_watch 276 |
64 |
|
|
# define __NR_inotify_rm_watch 277 |
65 |
|
|
|
66 |
root |
1.1 |
#elif defined (__s390__) |
67 |
root |
1.2 |
# define __NR_inotify_init 284 |
68 |
|
|
# define __NR_inotify_add_watch 285 |
69 |
|
|
# define __NR_inotify_rm_watch 286 |
70 |
|
|
|
71 |
|
|
#elif defined (__sh__) |
72 |
|
|
# define __NR_inotify_init 290 |
73 |
|
|
# define __NR_inotify_add_watch 291 |
74 |
|
|
# define __NR_inotify_rm_watch 292 |
75 |
|
|
|
76 |
|
|
#elif defined (__sh64__) |
77 |
|
|
# define __NR_inotify_init 318 |
78 |
|
|
# define __NR_inotify_add_watch 319 |
79 |
|
|
# define __NR_inotify_rm_watch 320 |
80 |
|
|
|
81 |
root |
1.1 |
#elif defined (__sparc__) || defined (__sparc64__) |
82 |
root |
1.2 |
# define __NR_inotify_init 151 |
83 |
|
|
# define __NR_inotify_add_watch 152 |
84 |
|
|
# define __NR_inotify_rm_watch 156 |
85 |
|
|
|
86 |
|
|
#elif defined(__x86_64__) |
87 |
|
|
# define __NR_inotify_init 253 |
88 |
|
|
# define __NR_inotify_add_watch 254 |
89 |
|
|
# define __NR_inotify_rm_watch 255 |
90 |
|
|
|
91 |
root |
1.1 |
#else |
92 |
|
|
# error "Unsupported architecture!" |
93 |
|
|
#endif |
94 |
|
|
|
95 |
|
|
static inline int inotify_init (void) |
96 |
|
|
{ |
97 |
|
|
return syscall (__NR_inotify_init); |
98 |
|
|
} |
99 |
|
|
|
100 |
|
|
static inline int inotify_add_watch (int fd, const char *name, __u32 mask) |
101 |
|
|
{ |
102 |
|
|
return syscall (__NR_inotify_add_watch, fd, name, mask); |
103 |
|
|
} |
104 |
|
|
|
105 |
|
|
static inline int inotify_rm_watch (int fd, __u32 wd) |
106 |
|
|
{ |
107 |
|
|
return syscall (__NR_inotify_rm_watch, fd, wd); |
108 |
|
|
} |
109 |
|
|
|
110 |
|
|
#endif /* _LINUX_INOTIFY_SYSCALLS_H */ |