@@ -209,6 +209,13 @@ s! {
209209 pub ar_pln: u8 ,
210210 pub ar_op: u16 ,
211211 }
212+
213+ pub struct inotify_event {
214+ pub wd: :: c_int,
215+ pub mask: :: uint32_t,
216+ pub cookie: :: uint32_t,
217+ pub len: :: uint32_t
218+ }
212219}
213220
214221s_no_extra_traits ! {
@@ -1128,6 +1135,45 @@ pub const ARPHRD_IEEE802154: u16 = 804;
11281135pub const ARPHRD_VOID : u16 = 0xFFFF ;
11291136pub const ARPHRD_NONE : u16 = 0xFFFE ;
11301137
1138+ // uapi/linux/inotify.h
1139+ pub const IN_ACCESS : :: uint32_t = 0x0000_0001 ;
1140+ pub const IN_MODIFY : :: uint32_t = 0x0000_0002 ;
1141+ pub const IN_ATTRIB : :: uint32_t = 0x0000_0004 ;
1142+ pub const IN_CLOSE_WRITE : :: uint32_t = 0x0000_0008 ;
1143+ pub const IN_CLOSE_NOWRITE : :: uint32_t = 0x0000_0010 ;
1144+ pub const IN_CLOSE : :: uint32_t = ( IN_CLOSE_WRITE | IN_CLOSE_NOWRITE ) ;
1145+ pub const IN_OPEN : :: uint32_t = 0x0000_0020 ;
1146+ pub const IN_MOVED_FROM : :: uint32_t = 0x0000_0040 ;
1147+ pub const IN_MOVED_TO : :: uint32_t = 0x0000_0080 ;
1148+ pub const IN_MOVE : :: uint32_t = ( IN_MOVED_FROM | IN_MOVED_TO ) ;
1149+ pub const IN_CREATE : :: uint32_t = 0x0000_0100 ;
1150+ pub const IN_DELETE : :: uint32_t = 0x0000_0200 ;
1151+ pub const IN_DELETE_SELF : :: uint32_t = 0x0000_0400 ;
1152+ pub const IN_MOVE_SELF : :: uint32_t = 0x0000_0800 ;
1153+
1154+ pub const IN_UNMOUNT : :: uint32_t = 0x0000_2000 ;
1155+ pub const IN_Q_OVERFLOW : :: uint32_t = 0x0000_4000 ;
1156+ pub const IN_IGNORED : :: uint32_t = 0x0000_8000 ;
1157+
1158+ pub const IN_ONLYDIR : :: uint32_t = 0x0100_0000 ;
1159+ pub const IN_DONT_FOLLOW : :: uint32_t = 0x0200_0000 ;
1160+ // pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
1161+
1162+ // pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
1163+ // pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
1164+ pub const IN_ISDIR : :: uint32_t = 0x4000_0000 ;
1165+ pub const IN_ONESHOT : :: uint32_t = 0x8000_0000 ;
1166+
1167+ pub const IN_ALL_EVENTS : :: uint32_t = (
1168+ IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
1169+ IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
1170+ IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
1171+ IN_MOVE_SELF
1172+ ) ;
1173+
1174+ pub const IN_CLOEXEC : :: c_int = O_CLOEXEC ;
1175+ pub const IN_NONBLOCK : :: c_int = O_NONBLOCK ;
1176+
11311177fn CMSG_ALIGN ( len : usize ) -> usize {
11321178 len + mem:: size_of :: < usize > ( ) - 1 & !( mem:: size_of :: < usize > ( ) - 1 )
11331179}
@@ -1374,6 +1420,12 @@ extern {
13741420 pub fn recvmsg ( fd : :: c_int , msg : * mut :: msghdr , flags : :: c_int )
13751421 -> :: ssize_t ;
13761422 pub fn uname ( buf : * mut :: utsname ) -> :: c_int ;
1423+ pub fn inotify_init ( ) -> :: c_int ;
1424+ pub fn inotify_init1 ( flags : :: c_int ) -> :: c_int ;
1425+ pub fn inotify_add_watch ( fd : :: c_int ,
1426+ path : * const :: c_char ,
1427+ mask : :: uint32_t ) -> :: c_int ;
1428+ pub fn inotify_rm_watch ( fd : :: c_int , wd : :: c_int ) -> :: c_int ;
13771429}
13781430
13791431cfg_if ! {
0 commit comments