00001
00002
00003
00004
00005
00006
00007 #ifndef _LINUX_INOTIFY_H
00008 #define _LINUX_INOTIFY_H
00009
00010 #include <sys/types.h>
00011 #include <linux/limits.h>
00012 #include <linux/types.h>
00013
00014
00015
00016
00017
00018
00019
00020 struct inotify_event {
00021 __s32 wd;
00022 __u32 mask;
00023 __u32 cookie;
00024 __u32 len;
00025 char name[0];
00026 };
00027
00028
00029
00030
00031
00032
00033 struct inotify_watch_request {
00034 char *name;
00035 __u32 mask;
00036 };
00037
00038
00039 #define IN_ACCESS 0x00000001
00040 #define IN_MODIFY 0x00000002
00041 #define IN_ATTRIB 0x00000004
00042 #define IN_CLOSE_WRITE 0x00000008
00043 #define IN_CLOSE_NOWRITE 0x00000010
00044 #define IN_OPEN 0x00000020
00045 #define IN_MOVED_FROM 0x00000040
00046 #define IN_MOVED_TO 0x00000080
00047 #define IN_DELETE_SUBDIR 0x00000100
00048 #define IN_DELETE_FILE 0x00000200
00049 #define IN_CREATE_SUBDIR 0x00000400
00050 #define IN_CREATE_FILE 0x00000800
00051 #define IN_DELETE_SELF 0x00001000
00052 #define IN_UNMOUNT 0x00002000
00053 #define IN_Q_OVERFLOW 0x00004000
00054 #define IN_IGNORED 0x00008000
00055
00056
00057 #define IN_ALL_EVENTS 0xffffffff
00058 #define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)
00059
00060 #define INOTIFY_IOCTL_MAGIC 'Q'
00061 #define INOTIFY_IOCTL_MAXNR 2
00062
00063 #define INOTIFY_WATCH _IOR(INOTIFY_IOCTL_MAGIC, 1, struct inotify_watch_request)
00064 #define INOTIFY_IGNORE _IOR(INOTIFY_IOCTL_MAGIC, 2, int)
00065
00066 #ifdef __KERNEL__
00067
00068 #include <linux/dcache.h>
00069 #include <linux/fs.h>
00070 #include <linux/config.h>
00071 #include <asm/atomic.h>
00072
00073 #ifdef CONFIG_INOTIFY
00074
00075 extern void inotify_inode_queue_event(struct inode *, __u32, __u32,
00076 const char *);
00077 extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32,
00078 const char *);
00079 extern void inotify_super_block_umount(struct super_block *);
00080 extern void inotify_inode_is_dead(struct inode *);
00081 extern u32 inotify_get_cookie(void);
00082
00083 #else
00084
00085 static inline void inotify_inode_queue_event(struct inode *inode,
00086 __u32 mask, __u32 cookie,
00087 const char *filename)
00088 {
00089 }
00090
00091 static inline void inotify_dentry_parent_queue_event(struct dentry *dentry,
00092 __u32 mask, __u32 cookie,
00093 const char *filename)
00094 {
00095 }
00096
00097 static inline void inotify_super_block_umount(struct super_block *sb)
00098 {
00099 }
00100
00101 static inline void inotify_inode_is_dead(struct inode *inode)
00102 {
00103 }
00104
00105 static inline u32 inotify_get_cookie(void)
00106 {
00107 return 0;
00108 }
00109
00110 #endif
00111
00112 #endif
00113
00114 #endif