Skip to content

Commit 600f635

Browse files
committed
Auto merge of #1306 - gnzlbg:fix_asmjs, r=gnzlbg
Don't fix asmjs and wasm32 build jobs This doesn't fix the jobs, but at least now libc-test reports no errors, even though they still fail to link.
2 parents e1c9ad1 + 8abce83 commit 600f635

File tree

4 files changed

+119
-72
lines changed

4 files changed

+119
-72
lines changed

libc-test/build.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,22 +1065,18 @@ fn test_openbsd(target: &str) {
10651065
}
10661066
});
10671067

1068-
cfg.field_name(move |struct_, field| {
1069-
match field {
1070-
"st_birthtime" if struct_.starts_with("stat") => {
1071-
"__st_birthtime".to_string()
1072-
}
1073-
"st_birthtime_nsec" if struct_.starts_with("stat") => {
1074-
"__st_birthtimensec".to_string()
1075-
}
1076-
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
1077-
s.replace("e_nsec", ".tv_nsec")
1078-
}
1079-
"sa_sigaction" if struct_ == "sigaction" => {
1080-
"sa_handler".to_string()
1081-
}
1082-
s => s.to_string(),
1068+
cfg.field_name(move |struct_, field| match field {
1069+
"st_birthtime" if struct_.starts_with("stat") => {
1070+
"__st_birthtime".to_string()
1071+
}
1072+
"st_birthtime_nsec" if struct_.starts_with("stat") => {
1073+
"__st_birthtimensec".to_string()
1074+
}
1075+
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
1076+
s.replace("e_nsec", ".tv_nsec")
10831077
}
1078+
"sa_sigaction" if struct_ == "sigaction" => "sa_handler".to_string(),
1079+
s => s.to_string(),
10841080
});
10851081

10861082
cfg.skip_field_type(move |struct_, field| {

src/unix/notbsd/android/mod.rs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ s! {
190190
pub ipi6_addr: ::in6_addr,
191191
pub ipi6_ifindex: ::c_int,
192192
}
193+
194+
pub struct inotify_event {
195+
pub wd: ::c_int,
196+
pub mask: ::uint32_t,
197+
pub cookie: ::uint32_t,
198+
pub len: ::uint32_t
199+
}
193200
}
194201

195202
s_no_extra_traits!{
@@ -1356,6 +1363,11 @@ pub const IP_ORIGDSTADDR : ::c_int = 20;
13561363
pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR;
13571364
pub const IPV6_ORIGDSTADDR : ::c_int = 74;
13581365
pub const IPV6_RECVORIGDSTADDR : ::c_int = IPV6_ORIGDSTADDR;
1366+
pub const IPV6_FLOWINFO: ::c_int = 11;
1367+
pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
1368+
pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
1369+
pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
1370+
pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
13591371
pub const IUTF8: ::tcflag_t = 0x00004000;
13601372
pub const CMSPAR: ::tcflag_t = 0o10000000000;
13611373
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
@@ -1790,6 +1802,43 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
17901802
pub const ALG_OP_DECRYPT: ::c_int = 0;
17911803
pub const ALG_OP_ENCRYPT: ::c_int = 1;
17921804

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+
17931842
f! {
17941843
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
17951844
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -2055,6 +2104,11 @@ extern {
20552104
flags: ::c_int) -> ::c_int;
20562105
pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint,
20572106
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;
20582112
}
20592113

20602114
cfg_if! {

src/unix/notbsd/linux/mod.rs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,13 @@ s! {
493493
pub updated: ::c_ulong,
494494
pub ha: [::c_uchar; ::MAX_ADDR_LEN],
495495
}
496+
497+
pub struct inotify_event {
498+
pub wd: ::c_int,
499+
pub mask: ::uint32_t,
500+
pub cookie: ::uint32_t,
501+
pub len: ::uint32_t
502+
}
496503
}
497504

498505
s_no_extra_traits!{
@@ -1409,6 +1416,11 @@ pub const IP_ORIGDSTADDR : ::c_int = 20;
14091416
pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR;
14101417
pub const IPV6_ORIGDSTADDR : ::c_int = 74;
14111418
pub const IPV6_RECVORIGDSTADDR : ::c_int = IPV6_ORIGDSTADDR;
1419+
pub const IPV6_FLOWINFO: ::c_int = 11;
1420+
pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
1421+
pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
1422+
pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
1423+
pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
14121424
pub const IUTF8: ::tcflag_t = 0x00004000;
14131425
pub const CMSPAR: ::tcflag_t = 0o10000000000;
14141426

@@ -1800,6 +1812,43 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
18001812
pub const ALG_OP_DECRYPT: ::c_int = 0;
18011813
pub const ALG_OP_ENCRYPT: ::c_int = 1;
18021814

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+
18031852
f! {
18041853
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
18051854
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -2385,6 +2434,11 @@ extern {
23852434
stream: *mut ::FILE
23862435
) -> ::size_t;
23872436
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;
23882442
}
23892443

23902444
cfg_if! {

src/unix/notbsd/mod.rs

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,6 @@ s! {
208208
pub ar_op: u16,
209209
}
210210

211-
pub struct inotify_event {
212-
pub wd: ::c_int,
213-
pub mask: ::uint32_t,
214-
pub cookie: ::uint32_t,
215-
pub len: ::uint32_t
216-
}
217-
218211
pub struct mmsghdr {
219212
pub msg_hdr: ::msghdr,
220213
pub msg_len: ::c_uint,
@@ -807,24 +800,18 @@ pub const IP_RECVTOS: ::c_int = 13;
807800
pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
808801
pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
809802
pub const IP_TRANSPARENT: ::c_int = 19;
810-
pub const IPV6_FLOWINFO: ::c_int = 11;
811803
pub const IPV6_UNICAST_HOPS: ::c_int = 16;
812804
pub const IPV6_MULTICAST_IF: ::c_int = 17;
813805
pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
814806
pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
815807
pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
816808
pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
817809
pub const IPV6_V6ONLY: ::c_int = 26;
818-
pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
819-
pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
820810
pub const IPV6_RECVPKTINFO: ::c_int = 49;
821811
pub const IPV6_PKTINFO: ::c_int = 50;
822812
pub const IPV6_RECVTCLASS: ::c_int = 66;
823813
pub const IPV6_TCLASS: ::c_int = 67;
824814

825-
pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
826-
pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
827-
828815
pub const TCP_NODELAY: ::c_int = 1;
829816
pub const TCP_MAXSEG: ::c_int = 2;
830817
pub const TCP_CORK: ::c_int = 3;
@@ -1167,45 +1154,6 @@ pub const ARPHRD_IEEE802154: u16 = 804;
11671154
pub const ARPHRD_VOID: u16 = 0xFFFF;
11681155
pub const ARPHRD_NONE: u16 = 0xFFFE;
11691156

1170-
// uapi/linux/inotify.h
1171-
pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
1172-
pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
1173-
pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
1174-
pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
1175-
pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
1176-
pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
1177-
pub const IN_OPEN: ::uint32_t = 0x0000_0020;
1178-
pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
1179-
pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
1180-
pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
1181-
pub const IN_CREATE: ::uint32_t = 0x0000_0100;
1182-
pub const IN_DELETE: ::uint32_t = 0x0000_0200;
1183-
pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
1184-
pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
1185-
1186-
pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
1187-
pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
1188-
pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
1189-
1190-
pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
1191-
pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
1192-
// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
1193-
1194-
// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
1195-
// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
1196-
pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
1197-
pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;
1198-
1199-
pub const IN_ALL_EVENTS: ::uint32_t = (
1200-
IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
1201-
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
1202-
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
1203-
IN_MOVE_SELF
1204-
);
1205-
1206-
pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
1207-
pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
1208-
12091157
fn CMSG_ALIGN(len: usize) -> usize {
12101158
len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
12111159
}
@@ -1458,11 +1406,6 @@ extern {
14581406
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
14591407
-> ::ssize_t;
14601408
pub fn uname(buf: *mut ::utsname) -> ::c_int;
1461-
pub fn inotify_init() -> ::c_int;
1462-
pub fn inotify_init1(flags: ::c_int) -> ::c_int;
1463-
pub fn inotify_add_watch(fd: ::c_int,
1464-
path: *const ::c_char,
1465-
mask: ::uint32_t) -> ::c_int;
14661409
}
14671410

14681411
cfg_if! {

0 commit comments

Comments
 (0)