summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-03-26 10:11:55 +0000
committerbors <bors@rust-lang.org>2019-03-26 10:11:55 +0000
commit600f635072005a59140de119fd4defc79f569d54 (patch)
tree03bb40ddf1b14ae2ac46b0812620dabbd6248fa5
parente1c9ad190b48da673a672c501c423e72a6ed2ba2 (diff)
parent8abce839fc270e4bd25ba8879c76b766b93fd490 (diff)
downloadrust-libc-600f635072005a59140de119fd4defc79f569d54.tar.gz
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.
-rw-r--r--libc-test/build.rs26
-rw-r--r--src/unix/notbsd/android/mod.rs54
-rw-r--r--src/unix/notbsd/linux/mod.rs54
-rw-r--r--src/unix/notbsd/mod.rs57
4 files changed, 119 insertions, 72 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index d3d35614e7..9ecfdc0d59 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1065,22 +1065,18 @@ fn test_openbsd(target: &str) {
}
});
- cfg.field_name(move |struct_, field| {
- match field {
- "st_birthtime" if struct_.starts_with("stat") => {
- "__st_birthtime".to_string()
- }
- "st_birthtime_nsec" if struct_.starts_with("stat") => {
- "__st_birthtimensec".to_string()
- }
- s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
- s.replace("e_nsec", ".tv_nsec")
- }
- "sa_sigaction" if struct_ == "sigaction" => {
- "sa_handler".to_string()
- }
- s => s.to_string(),
+ cfg.field_name(move |struct_, field| match field {
+ "st_birthtime" if struct_.starts_with("stat") => {
+ "__st_birthtime".to_string()
+ }
+ "st_birthtime_nsec" if struct_.starts_with("stat") => {
+ "__st_birthtimensec".to_string()
+ }
+ s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
+ s.replace("e_nsec", ".tv_nsec")
}
+ "sa_sigaction" if struct_ == "sigaction" => "sa_handler".to_string(),
+ s => s.to_string(),
});
cfg.skip_field_type(move |struct_, field| {
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index 2f62a0930d..f7fe61a21d 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -190,6 +190,13 @@ s! {
pub ipi6_addr: ::in6_addr,
pub ipi6_ifindex: ::c_int,
}
+
+ pub struct inotify_event {
+ pub wd: ::c_int,
+ pub mask: ::uint32_t,
+ pub cookie: ::uint32_t,
+ pub len: ::uint32_t
+ }
}
s_no_extra_traits!{
@@ -1356,6 +1363,11 @@ pub const IP_ORIGDSTADDR : ::c_int = 20;
pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR;
pub const IPV6_ORIGDSTADDR : ::c_int = 74;
pub const IPV6_RECVORIGDSTADDR : ::c_int = IPV6_ORIGDSTADDR;
+pub const IPV6_FLOWINFO: ::c_int = 11;
+pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
+pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
+pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
+pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CMSPAR: ::tcflag_t = 0o10000000000;
pub const O_TMPFILE: ::c_int = 0o20000000 | O_DIRECTORY;
@@ -1790,6 +1802,43 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;
+// uapi/linux/inotify.h
+pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
+pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
+pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
+pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
+pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
+pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
+pub const IN_OPEN: ::uint32_t = 0x0000_0020;
+pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
+pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
+pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
+pub const IN_CREATE: ::uint32_t = 0x0000_0100;
+pub const IN_DELETE: ::uint32_t = 0x0000_0200;
+pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
+pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
+pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
+pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
+pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
+pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
+pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
+// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
+
+// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
+// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
+pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
+pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;
+
+pub const IN_ALL_EVENTS: ::uint32_t = (
+ IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
+ IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
+ IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
+ IN_MOVE_SELF
+);
+
+pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
+
f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -2055,6 +2104,11 @@ extern {
flags: ::c_int) -> ::c_int;
pub fn recvmmsg(sockfd: ::c_int, msgvec: *mut ::mmsghdr, vlen: ::c_uint,
flags: ::c_int, timeout: *const ::timespec) -> ::c_int;
+ pub fn inotify_init() -> ::c_int;
+ pub fn inotify_init1(flags: ::c_int) -> ::c_int;
+ pub fn inotify_add_watch(fd: ::c_int,
+ path: *const ::c_char,
+ mask: ::uint32_t) -> ::c_int;
}
cfg_if! {
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index b9ecc9de9f..14c2463fa9 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -493,6 +493,13 @@ s! {
pub updated: ::c_ulong,
pub ha: [::c_uchar; ::MAX_ADDR_LEN],
}
+
+ pub struct inotify_event {
+ pub wd: ::c_int,
+ pub mask: ::uint32_t,
+ pub cookie: ::uint32_t,
+ pub len: ::uint32_t
+ }
}
s_no_extra_traits!{
@@ -1409,6 +1416,11 @@ pub const IP_ORIGDSTADDR : ::c_int = 20;
pub const IP_RECVORIGDSTADDR : ::c_int = IP_ORIGDSTADDR;
pub const IPV6_ORIGDSTADDR : ::c_int = 74;
pub const IPV6_RECVORIGDSTADDR : ::c_int = IPV6_ORIGDSTADDR;
+pub const IPV6_FLOWINFO: ::c_int = 11;
+pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
+pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
+pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
+pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CMSPAR: ::tcflag_t = 0o10000000000;
@@ -1800,6 +1812,43 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;
+// uapi/linux/inotify.h
+pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
+pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
+pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
+pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
+pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
+pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
+pub const IN_OPEN: ::uint32_t = 0x0000_0020;
+pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
+pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
+pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
+pub const IN_CREATE: ::uint32_t = 0x0000_0100;
+pub const IN_DELETE: ::uint32_t = 0x0000_0200;
+pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
+pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
+pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
+pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
+pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
+pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
+pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
+// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
+
+// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
+// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
+pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
+pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;
+
+pub const IN_ALL_EVENTS: ::uint32_t = (
+ IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
+ IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
+ IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
+ IN_MOVE_SELF
+);
+
+pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
+pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
+
f! {
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
cmsg: *const cmsghdr) -> *mut cmsghdr {
@@ -2385,6 +2434,11 @@ extern {
stream: *mut ::FILE
) -> ::size_t;
pub fn inotify_rm_watch(fd: ::c_int, wd: ::c_int) -> ::c_int;
+ pub fn inotify_init() -> ::c_int;
+ pub fn inotify_init1(flags: ::c_int) -> ::c_int;
+ pub fn inotify_add_watch(fd: ::c_int,
+ path: *const ::c_char,
+ mask: ::uint32_t) -> ::c_int;
}
cfg_if! {
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 13ddb292d3..2af3913097 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -208,13 +208,6 @@ s! {
pub ar_op: u16,
}
- pub struct inotify_event {
- pub wd: ::c_int,
- pub mask: ::uint32_t,
- pub cookie: ::uint32_t,
- pub len: ::uint32_t
- }
-
pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
@@ -807,7 +800,6 @@ pub const IP_RECVTOS: ::c_int = 13;
pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
pub const IP_TRANSPARENT: ::c_int = 19;
-pub const IPV6_FLOWINFO: ::c_int = 11;
pub const IPV6_UNICAST_HOPS: ::c_int = 16;
pub const IPV6_MULTICAST_IF: ::c_int = 17;
pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
@@ -815,16 +807,11 @@ pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
pub const IPV6_V6ONLY: ::c_int = 26;
-pub const IPV6_FLOWLABEL_MGR: ::c_int = 32;
-pub const IPV6_FLOWINFO_SEND: ::c_int = 33;
pub const IPV6_RECVPKTINFO: ::c_int = 49;
pub const IPV6_PKTINFO: ::c_int = 50;
pub const IPV6_RECVTCLASS: ::c_int = 66;
pub const IPV6_TCLASS: ::c_int = 67;
-pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 0x000fffff;
-pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 0x0ff00000;
-
pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_MAXSEG: ::c_int = 2;
pub const TCP_CORK: ::c_int = 3;
@@ -1167,45 +1154,6 @@ pub const ARPHRD_IEEE802154: u16 = 804;
pub const ARPHRD_VOID: u16 = 0xFFFF;
pub const ARPHRD_NONE: u16 = 0xFFFE;
-// uapi/linux/inotify.h
-pub const IN_ACCESS: ::uint32_t = 0x0000_0001;
-pub const IN_MODIFY: ::uint32_t = 0x0000_0002;
-pub const IN_ATTRIB: ::uint32_t = 0x0000_0004;
-pub const IN_CLOSE_WRITE: ::uint32_t = 0x0000_0008;
-pub const IN_CLOSE_NOWRITE: ::uint32_t = 0x0000_0010;
-pub const IN_CLOSE: ::uint32_t = (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE);
-pub const IN_OPEN: ::uint32_t = 0x0000_0020;
-pub const IN_MOVED_FROM: ::uint32_t = 0x0000_0040;
-pub const IN_MOVED_TO: ::uint32_t = 0x0000_0080;
-pub const IN_MOVE: ::uint32_t = (IN_MOVED_FROM | IN_MOVED_TO);
-pub const IN_CREATE: ::uint32_t = 0x0000_0100;
-pub const IN_DELETE: ::uint32_t = 0x0000_0200;
-pub const IN_DELETE_SELF: ::uint32_t = 0x0000_0400;
-pub const IN_MOVE_SELF: ::uint32_t = 0x0000_0800;
-
-pub const IN_UNMOUNT: ::uint32_t = 0x0000_2000;
-pub const IN_Q_OVERFLOW: ::uint32_t = 0x0000_4000;
-pub const IN_IGNORED: ::uint32_t = 0x0000_8000;
-
-pub const IN_ONLYDIR: ::uint32_t = 0x0100_0000;
-pub const IN_DONT_FOLLOW: ::uint32_t = 0x0200_0000;
-// pub const IN_EXCL_UNLINK: ::uint32_t = 0x0400_0000;
-
-// pub const IN_MASK_CREATE: ::uint32_t = 0x1000_0000;
-// pub const IN_MASK_ADD: ::uint32_t = 0x2000_0000;
-pub const IN_ISDIR: ::uint32_t = 0x4000_0000;
-pub const IN_ONESHOT: ::uint32_t = 0x8000_0000;
-
-pub const IN_ALL_EVENTS: ::uint32_t = (
- IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |
- IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |
- IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |
- IN_MOVE_SELF
-);
-
-pub const IN_CLOEXEC: ::c_int = O_CLOEXEC;
-pub const IN_NONBLOCK: ::c_int = O_NONBLOCK;
-
fn CMSG_ALIGN(len: usize) -> usize {
len + ::mem::size_of::<usize>() - 1 & !(::mem::size_of::<usize>() - 1)
}
@@ -1458,11 +1406,6 @@ extern {
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
-> ::ssize_t;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
- pub fn inotify_init() -> ::c_int;
- pub fn inotify_init1(flags: ::c_int) -> ::c_int;
- pub fn inotify_add_watch(fd: ::c_int,
- path: *const ::c_char,
- mask: ::uint32_t) -> ::c_int;
}
cfg_if! {