1 #ifndef _LINUX_INOTIFY_H
2 #define _LINUX_INOTIFY_H
5 #include <sys/syscall.h>
23 #define IN_ACCESS 0x00000001
24 #define IN_MODIFY 0x00000002
25 #define IN_ATTRIB 0x00000004
26 #define IN_CLOSE_WRITE 0x00000008
27 #define IN_CLOSE_NOWRITE 0x00000010
28 #define IN_OPEN 0x00000020
29 #define IN_MOVED_FROM 0x00000040
30 #define IN_MOVED_TO 0x00000080
31 #define IN_CREATE 0x00000100
32 #define IN_DELETE 0x00000200
33 #define IN_DELETE_SELF 0x00000400
34 #define IN_MOVE_SELF 0x00000800
37 #define IN_UNMOUNT 0x00002000
38 #define IN_Q_OVERFLOW 0x00004000
39 #define IN_IGNORED 0x00008000
42 #define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)
43 #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO)
46 #define IN_ONLYDIR 0x01000000
47 #define IN_DONT_FOLLOW 0x02000000
48 #define IN_MASK_ADD 0x20000000
49 #define IN_ISDIR 0x40000000
50 #define IN_ONESHOT 0x80000000
57 #define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
58 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
59 IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
62 #if defined (__alpha__)
63 # define __NR_inotify_init 444
64 # define __NR_inotify_add_watch 445
65 # define __NR_inotify_rm_watch 446
67 #elif defined (__arm__)
68 # define __NR_inotify_init (__NR_SYSCALL_BASE+316)
69 # define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
70 # define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
72 #elif defined (__frv__)
73 # define __NR_inotify_init 291
74 # define __NR_inotify_add_watch 292
75 # define __NR_inotify_rm_watch 293
77 #elif defined(__i386__)
78 # define __NR_inotify_init 291
79 # define __NR_inotify_add_watch 292
80 # define __NR_inotify_rm_watch 293
82 #elif defined (__ia64__)
83 # define __NR_inotify_init 1277
84 # define __NR_inotify_add_watch 1278
85 # define __NR_inotify_rm_watch 1279
87 #elif defined (__mips__)
88 # if _MIPS_SIM == _MIPS_SIM_ABI32
89 # define __NR_inotify_init (__NR_Linux + 284)
90 # define __NR_inotify_add_watch (__NR_Linux + 285)
91 # define __NR_inotify_rm_watch (__NR_Linux + 286)
93 # if _MIPS_SIM == _MIPS_SIM_ABI64
94 # define __NR_inotify_init (__NR_Linux + 243)
95 # define __NR_inotify_add_watch (__NR_Linux + 243)
96 # define __NR_inotify_rm_watch (__NR_Linux + 243)
98 # if _MIPS_SIM == _MIPS_SIM_NABI32
99 # define __NR_inotify_init (__NR_Linux + 247)
100 # define __NR_inotify_add_watch (__NR_Linux + 248)
101 # define __NR_inotify_rm_watch (__NR_Linux + 249)
104 #elif defined(__parisc__)
105 # define __NR_inotify_init (__NR_Linux + 269)
106 # define __NR_inotify_add_watch (__NR_Linux + 270)
107 # define __NR_inotify_rm_watch (__NR_Linux + 271)
109 #elif defined(__powerpc__) || defined(__powerpc64__)
110 # define __NR_inotify_init 275
111 # define __NR_inotify_add_watch 276
112 # define __NR_inotify_rm_watch 277
114 #elif defined (__s390__)
115 # define __NR_inotify_init 284
116 # define __NR_inotify_add_watch 285
117 # define __NR_inotify_rm_watch 286
119 #elif defined (__sh__)
120 # define __NR_inotify_init 290
121 # define __NR_inotify_add_watch 291
122 # define __NR_inotify_rm_watch 292
124 #elif defined (__sh64__)
125 # define __NR_inotify_init 318
126 # define __NR_inotify_add_watch 319
127 # define __NR_inotify_rm_watch 320
129 #elif defined (__sparc__) || defined (__sparc64__)
130 # define __NR_inotify_init 151
131 # define __NR_inotify_add_watch 152
132 # define __NR_inotify_rm_watch 156
134 #elif defined(__x86_64__)
135 # define __NR_inotify_init 253
136 # define __NR_inotify_add_watch 254
137 # define __NR_inotify_rm_watch 255
140 # error "Unsupported architecture!"
145 return syscall (__NR_inotify_init);
150 return syscall (__NR_inotify_add_watch, fd, name, mask);
155 return syscall (__NR_inotify_rm_watch, fd, wd);
char name __flexarr
Definition: inotify-nosys.h:19
static int inotify_add_watch(int fd, const char *name, uint32_t mask)
Definition: inotify-nosys.h:148
static int inotify_rm_watch(int fd, uint32_t wd)
Definition: inotify-nosys.h:153
unsigned int uint32_t
Definition: stdint.h:80
uint32_t len
Definition: inotify-nosys.h:18
Definition: inotify-nosys.h:14
int wd
Definition: inotify-nosys.h:15
uint32_t cookie
Definition: inotify-nosys.h:17
static int inotify_init(void)
Definition: inotify-nosys.h:143
uint32_t mask
Definition: inotify-nosys.h:16