summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgnzlbg <gonzalobg88@gmail.com>2019-05-27 14:09:40 +0200
committergnzlbg <gonzalobg88@gmail.com>2019-05-27 22:23:02 +0200
commit1cbc523e50d7dd37f13330d3ef5b80d84b76705e (patch)
treee577a1fc451ef9de69cd95c47ae8c4c463906bc8
parent8f403e5ac262508b763da173d545195710d10494 (diff)
downloadrust-libc-1cbc523e50d7dd37f13330d3ef5b80d84b76705e.tar.gz
[breaking change] MADV_SOFT_OFFLINE is undefined on MIPS
-rw-r--r--libc-test/build.rs27
-rw-r--r--src/unix/notbsd/android/mod.rs1
-rw-r--r--src/unix/notbsd/emscripten/mod.rs1
-rw-r--r--src/unix/notbsd/linux/mips/mod.rs2
-rw-r--r--src/unix/notbsd/linux/musl/b32/arm.rs1
-rw-r--r--src/unix/notbsd/linux/musl/b32/powerpc.rs1
-rw-r--r--src/unix/notbsd/linux/musl/b32/x86.rs1
-rw-r--r--src/unix/notbsd/linux/musl/b64/aarch64.rs1
-rw-r--r--src/unix/notbsd/linux/musl/b64/powerpc64.rs1
-rw-r--r--src/unix/notbsd/linux/musl/b64/x86_64.rs1
-rw-r--r--src/unix/notbsd/linux/other/mod.rs1
-rw-r--r--src/unix/notbsd/linux/s390x/mod.rs1
-rw-r--r--src/unix/notbsd/mod.rs1
13 files changed, 34 insertions, 6 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 9600c72742..987ff9dd89 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1995,6 +1995,10 @@ fn test_linux(target: &str) {
),
}
+ let arm = target.contains("arm");
+ let x86_64 = target.contains("x86_64");
+ let x86_32 = target.contains("i686");
+ let x32 = target.contains("x32");
let mips = target.contains("mips");
let mips32 = mips && !target.contains("64");
@@ -2046,7 +2050,6 @@ fn test_linux(target: &str) {
"stdio.h",
"stdlib.h",
"string.h",
- "sys/sysctl.h",
"sys/epoll.h",
"sys/eventfd.h",
"sys/file.h",
@@ -2097,15 +2100,27 @@ fn test_linux(target: &str) {
// `sys/io.h` is only available on x86*, Alpha, IA64, and 32-bit ARM:
// https://bugzilla.redhat.com/show_bug.cgi?id=1116162
- if target.contains("x86") || target.contains("arm") {
+ if x86_64 || x86_32 || arm {
headers! { cfg: "sys/io.h" }
}
// `sys/reg.h` is only available on x86 and x86_64
- if target.contains("x86") {
+ if x86_64 || x86_32 {
headers! { cfg: "sys/reg.h" }
}
+ // sysctl system call is deprecated and not available on musl
+ // It is also unsupported in x32:
+ if !(x32 || musl) {
+ headers! { cfg: "sys/sysctl.h"}
+ }
+
+ // <execinfo.h> is not supported by musl:
+ // https://www.openwall.com/lists/musl/2015/04/09/3
+ if !musl {
+ headers! { cfg: "execinfo.h" }
+ }
+
// Include linux headers at the end:
headers! {
cfg:
@@ -2115,7 +2130,6 @@ fn test_linux(target: &str) {
"linux/fs.h",
"linux/futex.h",
"linux/genetlink.h",
- "linux/if.h",
"linux/if_addr.h",
"linux/if_alg.h",
"linux/if_ether.h",
@@ -2138,6 +2152,11 @@ fn test_linux(target: &str) {
"sys/auxv.h",
}
+ // FIXME: https://github.com/sabotage-linux/kernel-headers/issues/16
+ if !musl {
+ headers!{ cfg: "linux/if.h" }
+ }
+
// note: aio.h must be included before sys/mount.h
headers! { cfg:
"sys/xattr.h",
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index 05d49002c1..e4dfa1f6b3 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -548,6 +548,7 @@ cfg_if! {
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MS_NOUSER: ::c_ulong = 0xffffffff80000000;
pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
diff --git a/src/unix/notbsd/emscripten/mod.rs b/src/unix/notbsd/emscripten/mod.rs
index f1ab424b88..da4edea5cc 100644
--- a/src/unix/notbsd/emscripten/mod.rs
+++ b/src/unix/notbsd/emscripten/mod.rs
@@ -574,6 +574,7 @@ cfg_if! {
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MS_NOUSER: ::c_ulong = 0x80000000;
pub const MS_RMT_MASK: ::c_ulong = 0x800051;
diff --git a/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs
index c5253accad..d645fdaa99 100644
--- a/src/unix/notbsd/linux/mips/mod.rs
+++ b/src/unix/notbsd/linux/mips/mod.rs
@@ -894,7 +894,7 @@ pub const NFT_NG_INCREMENTAL: ::c_int = 0;
pub const NFT_NG_RANDOM: ::c_int = 1;
#[doc(hidden)]
-pub const AF_MAX: ::c_int = 42;
+pub const AF_MAX: ::c_int = 45;
#[doc(hidden)]
pub const PF_MAX: ::c_int = AF_MAX;
diff --git a/src/unix/notbsd/linux/musl/b32/arm.rs b/src/unix/notbsd/linux/musl/b32/arm.rs
index 94f1a80f55..c5feafc12d 100644
--- a/src/unix/notbsd/linux/musl/b32/arm.rs
+++ b/src/unix/notbsd/linux/musl/b32/arm.rs
@@ -182,6 +182,7 @@ pub const RLIMIT_NPROC: ::c_int = 6;
pub const RLIMIT_MEMLOCK: ::c_int = 8;
pub const RLIMIT_NLIMITS: ::c_int = 15;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const CBAUD: ::tcflag_t = 0o0010017;
diff --git a/src/unix/notbsd/linux/musl/b32/powerpc.rs b/src/unix/notbsd/linux/musl/b32/powerpc.rs
index d0f2d68293..f62cf6295d 100644
--- a/src/unix/notbsd/linux/musl/b32/powerpc.rs
+++ b/src/unix/notbsd/linux/musl/b32/powerpc.rs
@@ -166,6 +166,7 @@ s! {
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const SIGSTKSZ: ::size_t = 10240;
pub const MINSIGSTKSZ: ::size_t = 4096;
diff --git a/src/unix/notbsd/linux/musl/b32/x86.rs b/src/unix/notbsd/linux/musl/b32/x86.rs
index 0f620fe5fb..95395f0a7a 100644
--- a/src/unix/notbsd/linux/musl/b32/x86.rs
+++ b/src/unix/notbsd/linux/musl/b32/x86.rs
@@ -242,6 +242,7 @@ pub const RLIMIT_NPROC: ::c_int = 6;
pub const RLIMIT_MEMLOCK: ::c_int = 8;
pub const RLIMIT_NLIMITS: ::c_int = 15;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const CBAUD: ::tcflag_t = 0o0010017;
diff --git a/src/unix/notbsd/linux/musl/b64/aarch64.rs b/src/unix/notbsd/linux/musl/b64/aarch64.rs
index 018aaa9b50..af654e31a3 100644
--- a/src/unix/notbsd/linux/musl/b64/aarch64.rs
+++ b/src/unix/notbsd/linux/musl/b64/aarch64.rs
@@ -75,6 +75,7 @@ pub const PF_MAX: ::c_int = 45;
#[doc(hidden)]
pub const AF_MAX: ::c_int = PF_MAX;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;
pub const SYS_io_submit: ::c_long = 2;
diff --git a/src/unix/notbsd/linux/musl/b64/powerpc64.rs b/src/unix/notbsd/linux/musl/b64/powerpc64.rs
index 8f16047e5d..4230669087 100644
--- a/src/unix/notbsd/linux/musl/b64/powerpc64.rs
+++ b/src/unix/notbsd/linux/musl/b64/powerpc64.rs
@@ -60,6 +60,7 @@ s! {
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_32BIT: ::c_int = 0x0040;
pub const O_DIRECT: ::c_int = 0x20000;
pub const O_DIRECTORY: ::c_int = 0x4000;
diff --git a/src/unix/notbsd/linux/musl/b64/x86_64.rs b/src/unix/notbsd/linux/musl/b64/x86_64.rs
index 3a908354b5..3e2f1a435a 100644
--- a/src/unix/notbsd/linux/musl/b64/x86_64.rs
+++ b/src/unix/notbsd/linux/musl/b64/x86_64.rs
@@ -483,6 +483,7 @@ pub const ES: ::c_int = 24;
pub const FS: ::c_int = 25;
pub const GS: ::c_int = 26;
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MAP_32BIT: ::c_int = 0x0040;
pub const O_DIRECT: ::c_int = 0x4000;
pub const O_DIRECTORY: ::c_int = 0x10000;
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index 2ebb2acb45..351995e169 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -309,6 +309,7 @@ cfg_if! {
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
pub const __UT_LINESIZE: usize = 32;
diff --git a/src/unix/notbsd/linux/s390x/mod.rs b/src/unix/notbsd/linux/s390x/mod.rs
index 7785f9d59a..ba8bc3a8c2 100644
--- a/src/unix/notbsd/linux/s390x/mod.rs
+++ b/src/unix/notbsd/linux/s390x/mod.rs
@@ -353,6 +353,7 @@ cfg_if! {
}
}
+pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
pub const SFD_CLOEXEC: ::c_int = 0x080000;
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 2b6d6637a1..fcf1299dc5 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -643,7 +643,6 @@ pub const MADV_NOHUGEPAGE: ::c_int = 15;
pub const MADV_DONTDUMP: ::c_int = 16;
pub const MADV_DODUMP: ::c_int = 17;
pub const MADV_HWPOISON: ::c_int = 100;
-pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const IFF_UP: ::c_int = 0x1;
pub const IFF_BROADCAST: ::c_int = 0x2;