Thumbnail file hits. Based on a patch from D Bera
[beagle.git] / glue / inotify-syscalls.h
blobb88caf1752611de4ffd21861a1dbaed8ac12229c
1 #ifndef _LINUX_INOTIFY_SYSCALLS_H
2 #define _LINUX_INOTIFY_SYSCALLS_H
4 #include <sys/syscall.h>
6 #if defined(__i386__)
7 # define __NR_inotify_init 291
8 # define __NR_inotify_add_watch 292
9 # define __NR_inotify_rm_watch 293
10 #elif defined(__x86_64__)
11 # define __NR_inotify_init 253
12 # define __NR_inotify_add_watch 254
13 # define __NR_inotify_rm_watch 255
14 #elif defined(__powerpc__) || defined(__powerpc64__)
15 # define __NR_inotify_init 275
16 # define __NR_inotify_add_watch 276
17 # define __NR_inotify_rm_watch 277
18 #elif defined (__ia64__)
19 # define __NR_inotify_init 1277
20 # define __NR_inotify_add_watch 1278
21 # define __NR_inotify_rm_watch 1279
22 #elif defined (__s390__) || defined (__s390x__)
23 # define __NR_inotify_init 284
24 # define __NR_inotify_add_watch 285
25 # define __NR_inotify_rm_watch 286
26 #elif defined (__alpha__)
27 # define __NR_inotify_init 444
28 # define __NR_inotify_add_watch 445
29 # define __NR_inotify_rm_watch 446
30 #elif defined (__sparc__) || defined (__sparc64__)
31 # define __NR_inotify_init 151
32 # define __NR_inotify_add_watch 152
33 # define __NR_inotify_rm_watch 156
34 #elif defined (__arm__)
35 # define __NR_inotify_init 316
36 # define __NR_inotify_add_watch 317
37 # define __NR_inotify_rm_watch 318
38 #elif defined (__SH4__)
39 # define __NR_inotify_init 290
40 # define __NR_inotify_add_watch 291
41 # define __NR_inotify_rm_watch 292
42 #elif defined (__SH5__)
43 # define __NR_inotify_init 318
44 # define __NR_inotify_add_watch 319
45 # define __NR_inotify_rm_watch 320
46 #else
47 # error "Unsupported architecture!"
48 #endif
50 static inline int inotify_init (void)
52 return syscall (__NR_inotify_init);
55 static inline int inotify_add_watch (int fd, const char *name, __u32 mask)
57 return syscall (__NR_inotify_add_watch, fd, name, mask);
60 static inline int inotify_rm_watch (int fd, __u32 wd)
62 return syscall (__NR_inotify_rm_watch, fd, wd);
65 #endif /* _LINUX_INOTIFY_SYSCALLS_H */