summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Denhardt <ian@zenhack.net>2016-10-03 20:08:12 -0400
committerIan Denhardt <ian@zenhack.net>2016-10-05 18:53:52 -0400
commit0ecafc3197fdc24aff252cdbc26d03b51a3f9393 (patch)
treee1715dad0aeec79e5d48bd96b862f2ca511ee02e /src
parent8ff1c4172e4053d5f6a39d79d1cdea20ab7c2238 (diff)
downloadrust-libc-0ecafc3197fdc24aff252cdbc26d03b51a3f9393.tar.gz
Consolidate and fix musl-specific definitions.
Musl 1.1.14 defined these incorrectly, and we followed suit. They're fixed in 1.1.15, so we fix them here as well. Since these are kernel ABIs, the correct values match other libc implementations, so we move them up to the topmost module possible.
Diffstat (limited to 'src')
-rw-r--r--src/unix/notbsd/linux/mips.rs2
-rw-r--r--src/unix/notbsd/linux/mod.rs3
-rw-r--r--src/unix/notbsd/linux/musl/b32/arm.rs2
-rw-r--r--src/unix/notbsd/linux/musl/b32/asmjs.rs2
-rw-r--r--src/unix/notbsd/linux/musl/b32/mips.rs2
-rw-r--r--src/unix/notbsd/linux/musl/b32/x86.rs2
-rw-r--r--src/unix/notbsd/linux/musl/b64/mod.rs2
-rw-r--r--src/unix/notbsd/linux/musl/mod.rs2
-rw-r--r--src/unix/notbsd/linux/other/mod.rs2
-rw-r--r--src/unix/notbsd/linux/s390x.rs2
10 files changed, 5 insertions, 16 deletions
diff --git a/src/unix/notbsd/linux/mips.rs b/src/unix/notbsd/linux/mips.rs
index 83f4cfd4d4..085f2b31ce 100644
--- a/src/unix/notbsd/linux/mips.rs
+++ b/src/unix/notbsd/linux/mips.rs
@@ -233,12 +233,10 @@ pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const _SC_2_C_VERSION: ::c_int = 96;
-pub const RUSAGE_THREAD: ::c_int = 1;
pub const O_ACCMODE: ::c_int = 3;
pub const O_DIRECT: ::c_int = 0x8000;
pub const O_DIRECTORY: ::c_int = 0x10000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
-pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const ST_RELATIME: ::c_ulong = 4096;
pub const NI_MAXHOST: ::socklen_t = 1025;
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index 46ed80712e..6d08b56262 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -281,6 +281,9 @@ pub const CODESET: ::nl_item = 14;
pub const CRNCYSTR: ::nl_item = 0x4000F;
+pub const RUSAGE_THREAD: ::c_int = 1;
+pub const RUSAGE_CHILDREN: ::c_int = -1;
+
pub const RADIXCHAR: ::nl_item = 0x10000;
pub const THOUSEP: ::nl_item = 0x10001;
diff --git a/src/unix/notbsd/linux/musl/b32/arm.rs b/src/unix/notbsd/linux/musl/b32/arm.rs
index f07893c7ef..998580d3e2 100644
--- a/src/unix/notbsd/linux/musl/b32/arm.rs
+++ b/src/unix/notbsd/linux/musl/b32/arm.rs
@@ -332,7 +332,5 @@ pub const TIOCCONS: ::c_int = 0x541D;
pub const SYS_gettid: ::c_long = 224;
pub const SYS_perf_event_open: ::c_long = 364;
-pub const POSIX_MADV_DONTNEED: ::c_int = 0;
-pub const RUSAGE_CHILDREN: ::c_int = 1;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
diff --git a/src/unix/notbsd/linux/musl/b32/asmjs.rs b/src/unix/notbsd/linux/musl/b32/asmjs.rs
index c908e6cee1..91a96c185a 100644
--- a/src/unix/notbsd/linux/musl/b32/asmjs.rs
+++ b/src/unix/notbsd/linux/musl/b32/asmjs.rs
@@ -331,7 +331,5 @@ pub const TIOCCONS: ::c_int = 0x541D;
pub const SYS_gettid: ::c_long = 224; // Valid for arm (32-bit) and x86 (32-bit)
-pub const POSIX_MADV_DONTNEED: ::c_int = 0;
-pub const RUSAGE_CHILDREN: ::c_int = 1;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
diff --git a/src/unix/notbsd/linux/musl/b32/mips.rs b/src/unix/notbsd/linux/musl/b32/mips.rs
index 6c646b396d..9ebfe4a68f 100644
--- a/src/unix/notbsd/linux/musl/b32/mips.rs
+++ b/src/unix/notbsd/linux/musl/b32/mips.rs
@@ -340,7 +340,5 @@ pub const TIOCCONS: ::c_int = 0x80047478;
pub const SYS_gettid: ::c_long = 4222; // Valid for O32
pub const SYS_perf_event_open: ::c_long = 4333; // Valid for O32
-pub const POSIX_MADV_DONTNEED: ::c_int = 4;
-pub const RUSAGE_CHILDREN: ::c_int = !0;
pub const POLLWRNORM: ::c_short = 0x4;
pub const POLLWRBAND: ::c_short = 0x100;
diff --git a/src/unix/notbsd/linux/musl/b32/x86.rs b/src/unix/notbsd/linux/musl/b32/x86.rs
index 7f7b06ed14..194b8fd8bd 100644
--- a/src/unix/notbsd/linux/musl/b32/x86.rs
+++ b/src/unix/notbsd/linux/musl/b32/x86.rs
@@ -346,7 +346,5 @@ pub const TIOCCONS: ::c_int = 0x541D;
pub const SYS_gettid: ::c_long = 224;
pub const SYS_perf_event_open: ::c_long = 336;
-pub const POSIX_MADV_DONTNEED: ::c_int = 0;
-pub const RUSAGE_CHILDREN: ::c_int = 1;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
diff --git a/src/unix/notbsd/linux/musl/b64/mod.rs b/src/unix/notbsd/linux/musl/b64/mod.rs
index b389580d9d..fdaf52e166 100644
--- a/src/unix/notbsd/linux/musl/b64/mod.rs
+++ b/src/unix/notbsd/linux/musl/b64/mod.rs
@@ -351,8 +351,6 @@ pub const TIOCMSET: ::c_int = 0x5418;
pub const FIONREAD: ::c_int = 0x541B;
pub const TIOCCONS: ::c_int = 0x541D;
-pub const POSIX_MADV_DONTNEED: ::c_int = 0;
-pub const RUSAGE_CHILDREN: ::c_int = 1;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
diff --git a/src/unix/notbsd/linux/musl/mod.rs b/src/unix/notbsd/linux/musl/mod.rs
index a1672f7ec0..69a85b86ea 100644
--- a/src/unix/notbsd/linux/musl/mod.rs
+++ b/src/unix/notbsd/linux/musl/mod.rs
@@ -77,6 +77,8 @@ pub const PTHREAD_STACK_MIN: ::size_t = 2048;
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
+pub const POSIX_MADV_DONTNEED: ::c_int = 4;
+
pub const RLIM_INFINITY: ::rlim_t = !0;
pub const RLIMIT_RTTIME: ::c_int = 15;
pub const RLIMIT_NLIMITS: ::c_int = 16;
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index 8dc48bc149..b100cec54b 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -360,11 +360,9 @@ pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const _SC_2_C_VERSION: ::c_int = 96;
-pub const RUSAGE_THREAD: ::c_int = 1;
pub const O_ACCMODE: ::c_int = 3;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
-pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const ST_RELATIME: ::c_ulong = 4096;
pub const NI_MAXHOST: ::socklen_t = 1025;
diff --git a/src/unix/notbsd/linux/s390x.rs b/src/unix/notbsd/linux/s390x.rs
index d877425c02..7ecd799ea5 100644
--- a/src/unix/notbsd/linux/s390x.rs
+++ b/src/unix/notbsd/linux/s390x.rs
@@ -464,10 +464,8 @@ pub const TMP_MAX: ::c_uint = 238328;
pub const FOPEN_MAX: ::c_uint = 16;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const _SC_2_C_VERSION: ::c_int = 96;
-pub const RUSAGE_THREAD: ::c_int = 1;
pub const O_ASYNC: ::c_int = 0x2000;
pub const O_NDELAY: ::c_int = 0x800;
-pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const ST_RELATIME: ::c_ulong = 4096;
pub const NI_MAXHOST: ::socklen_t = 1025;