Skip to content

Commit 5026df5

Browse files
committed
Move inotify to the linux and android sub-modules
1 parent 2b6dd5f commit 5026df5

File tree

3 files changed

+84
-44
lines changed

3 files changed

+84
-44
lines changed

src/unix/notbsd/android/mod.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,43 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
18021802
pub const ALG_OP_DECRYPT: ::c_int = 0;
18031803
pub const ALG_OP_ENCRYPT: ::c_int = 1;
18041804

1805+
// uapi/linux/inotify.h
1806+
pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
1807+
pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
1808+
pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
1809+
pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
1810+
pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
1811+
pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
1812+
pub const IN_OPEN: ::uint32_t = 0x0000_0020;
1813+
pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
1814+
pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
1815+
pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
1816+
pub const IN_CREATE: ::uint32_t = 0x0000_0100;
1817+
pub const IN_DELETE: ::uint32_t = 0x0000_0200;
1818+
pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
1819+
pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
1820+
pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
1821+
pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
1822+
pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
1823+
pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
1824+
pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
1825+
// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
1826+
1827+
// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
1828+
// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
1829+
pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
1830+
pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;
1831+
1832+
pub const IN_ALL_EVENTS: ::uint32_t = (
1833+
IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
1834+
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
1835+
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
1836+
IN_MOVE_SELF
1837+
);
1838+
1839+
pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
1840+
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
1841+
18051842
f! {
18061843
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
18071844
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -2067,6 +2104,11 @@ extern {
20672104
flags: ::c_int) -> ::c_int;
20682105
pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint,
20692106
flags: ::c_int, timeout: *const ::timespec) -> ::c_int;
2107+
pub fn inotify_init() -> ::c_int;
2108+
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
2109+
pub fn inotify_add_watch(fd: ::c_int,
2110+
path: *const ::c_char,
2111+
mask: ::uint32_t) -> ::c_int;
20702112
}
20712113

20722114
cfg_if! {

src/unix/notbsd/linux/mod.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,6 +1812,43 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
18121812
pub const ALG_OP_DECRYPT: ::c_int = 0;
18131813
pub const ALG_OP_ENCRYPT: ::c_int = 1;
18141814

1815+
// uapi/linux/inotify.h
1816+
pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
1817+
pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
1818+
pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
1819+
pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
1820+
pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
1821+
pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
1822+
pub const IN_OPEN: ::uint32_t = 0x0000_0020;
1823+
pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
1824+
pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
1825+
pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
1826+
pub const IN_CREATE: ::uint32_t = 0x0000_0100;
1827+
pub const IN_DELETE: ::uint32_t = 0x0000_0200;
1828+
pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
1829+
pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
1830+
pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
1831+
pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
1832+
pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
1833+
pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
1834+
pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
1835+
// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
1836+
1837+
// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
1838+
// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
1839+
pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
1840+
pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;
1841+
1842+
pub const IN_ALL_EVENTS: ::uint32_t = (
1843+
IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
1844+
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
1845+
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
1846+
IN_MOVE_SELF
1847+
);
1848+
1849+
pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
1850+
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
1851+
18151852
f! {
18161853
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
18171854
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -2397,6 +2434,11 @@ extern {
23972434
stream: *mut ::FILE
23982435
) -> ::size_t;
23992436
pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int;
2437+
pub fn inotify_init() -> ::c_int;
2438+
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
2439+
pub fn inotify_add_watch(fd: ::c_int,
2440+
path: *const ::c_char,
2441+
mask: ::uint32_t) -> ::c_int;
24002442
}
24012443

24022444
cfg_if! {

src/unix/notbsd/mod.rs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,45 +1154,6 @@ pub const ARPHRD_IEEE802154: u16 = 804;
11541154
pub const ARPHRD_VOID: u16 = 0xFFFF;
11551155
pub const ARPHRD_NONE: u16 = 0xFFFE;
11561156

1157-
// uapi/linux/inotify.h
1158-
pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
1159-
pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
1160-
pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
1161-
pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
1162-
pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
1163-
pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
1164-
pub const IN_OPEN: ::uint32_t = 0x0000_0020;
1165-
pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
1166-
pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
1167-
pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
1168-
pub const IN_CREATE: ::uint32_t = 0x0000_0100;
1169-
pub const IN_DELETE: ::uint32_t = 0x0000_0200;
1170-
pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
1171-
pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
1172-
1173-
pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
1174-
pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
1175-
pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
1176-
1177-
pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
1178-
pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
1179-
// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
1180-
1181-
// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
1182-
// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
1183-
pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
1184-
pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;
1185-
1186-
pub const IN_ALL_EVENTS: ::uint32_t = (
1187-
IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
1188-
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
1189-
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
1190-
IN_MOVE_SELF
1191-
);
1192-
1193-
pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
1194-
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
1195-
11961157
fn CMSG_ALIGN(len: usize) -> usize {
11971158
len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
11981159
}
@@ -1445,11 +1406,6 @@ extern {
14451406
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
14461407
-> ::ssize_t;
14471408
pub fn uname(buf: *mut ::utsname) -> ::c_int;
1448-
pub fn inotify_init() -> ::c_int;
1449-
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
1450-
pub fn inotify_add_watch(fd: ::c_int,
1451-
path: *const ::c_char,
1452-
mask: ::uint32_t) -> ::c_int;
14531409
}
14541410

14551411
cfg_if! {

0 commit comments

Comments
 (0)