Skip to content

Commit 088a772

Browse files
committed
[breaking change] MADV_SOFT_OFFLINE is undefined on MIPS
1 parent bd52422 commit 088a772

File tree

13 files changed

+28
-5
lines changed

13 files changed

+28
-5
lines changed

libc-test/build.rs

+17-3
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,10 @@ fn test_linux(target: &str) {
19951995
),
19961996
}
19971997

1998+
let arm = target.contains("arm");
1999+
let x86_64 = target.contains("x86_64");
2000+
let x86_32 = target.contains("i686");
2001+
let x32 = target.contains("x32");
19982002
let mips = target.contains("mips");
19992003
let mips32 = mips && !target.contains("64");
20002004

@@ -2046,7 +2050,6 @@ fn test_linux(target: &str) {
20462050
"stdio.h",
20472051
"stdlib.h",
20482052
"string.h",
2049-
"sys/sysctl.h",
20502053
"sys/epoll.h",
20512054
"sys/eventfd.h",
20522055
"sys/file.h",
@@ -2097,15 +2100,26 @@ fn test_linux(target: &str) {
20972100

20982101
// `sys/io.h` is only available on x86*, Alpha, IA64, and 32-bit ARM:
20992102
// https://bugzilla.redhat.com/show_bug.cgi?id=1116162
2100-
if target.contains("x86") || target.contains("arm") {
2103+
if x86_64 || x86_32 || arm {
21012104
headers! { cfg: "sys/io.h" }
21022105
}
21032106

21042107
// `sys/reg.h` is only available on x86 and x86_64
2105-
if target.contains("x86") {
2108+
if x86_64 || x86_32 {
21062109
headers! { cfg: "sys/reg.h" }
21072110
}
21082111

2112+
// sysctl system call is unsupported in x32 kernel:
2113+
if !x32 {
2114+
headers! { cfg: "sys/sysctl.h"}
2115+
}
2116+
2117+
// <execinfo.h> is not supported by musl:
2118+
// https://www.openwall.com/lists/musl/2015/04/09/3
2119+
if !musl {
2120+
headers! { cfg: "execinfo.h" }
2121+
}
2122+
21092123
// Include linux headers at the end:
21102124
headers! {
21112125
cfg:

src/unix/notbsd/android/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ cfg_if! {
548548
}
549549
}
550550

551+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
551552
pub const MS_NOUSER: ::c_ulong = 0xffffffff80000000;
552553
pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
553554

src/unix/notbsd/emscripten/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ cfg_if! {
574574
}
575575
}
576576

577+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
577578
pub const MS_NOUSER: ::c_ulong = 0x80000000;
578579
pub const MS_RMT_MASK: ::c_ulong = 0x800051;
579580

src/unix/notbsd/linux/mips/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ pub const NFT_NG_INCREMENTAL: ::c_int = 0;
894894
pub const NFT_NG_RANDOM: ::c_int = 1;
895895

896896
#[doc(hidden)]
897-
pub const AF_MAX: ::c_int = 42;
897+
pub const AF_MAX: ::c_int = 45;
898898
#[doc(hidden)]
899899
pub const PF_MAX: ::c_int = AF_MAX;
900900

src/unix/notbsd/linux/musl/b32/arm.rs

+1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ pub const RLIMIT_NPROC: ::c_int = 6;
182182
pub const RLIMIT_MEMLOCK: ::c_int = 8;
183183
pub const RLIMIT_NLIMITS: ::c_int = 15;
184184

185+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
185186
pub const MCL_CURRENT: ::c_int = 0x0001;
186187
pub const MCL_FUTURE: ::c_int = 0x0002;
187188
pub const CBAUD: ::tcflag_t = 0o0010017;

src/unix/notbsd/linux/musl/b32/powerpc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ s! {
166166
}
167167
}
168168

169+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
169170
pub const SIGSTKSZ: ::size_t = 10240;
170171
pub const MINSIGSTKSZ: ::size_t = 4096;
171172

src/unix/notbsd/linux/musl/b32/x86.rs

+1
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ pub const RLIMIT_NPROC: ::c_int = 6;
242242
pub const RLIMIT_MEMLOCK: ::c_int = 8;
243243
pub const RLIMIT_NLIMITS: ::c_int = 15;
244244

245+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
245246
pub const MCL_CURRENT: ::c_int = 0x0001;
246247
pub const MCL_FUTURE: ::c_int = 0x0002;
247248
pub const CBAUD: ::tcflag_t = 0o0010017;

src/unix/notbsd/linux/musl/b64/aarch64.rs

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub const PF_MAX: ::c_int = 45;
7575
#[doc(hidden)]
7676
pub const AF_MAX: ::c_int = PF_MAX;
7777

78+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
7879
pub const SYS_io_setup: ::c_long = 0;
7980
pub const SYS_io_destroy: ::c_long = 1;
8081
pub const SYS_io_submit: ::c_long = 2;

src/unix/notbsd/linux/musl/b64/powerpc64.rs

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ s! {
6060
}
6161
}
6262

63+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
6364
pub const MAP_32BIT: ::c_int = 0x0040;
6465
pub const O_DIRECT: ::c_int = 0x20000;
6566
pub const O_DIRECTORY: ::c_int = 0x4000;

src/unix/notbsd/linux/musl/b64/x86_64.rs

+1
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ pub const ES: ::c_int = 24;
483483
pub const FS: ::c_int = 25;
484484
pub const GS: ::c_int = 26;
485485

486+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
486487
pub const MAP_32BIT: ::c_int = 0x0040;
487488
pub const O_DIRECT: ::c_int = 0x4000;
488489
pub const O_DIRECTORY: ::c_int = 0x10000;

src/unix/notbsd/linux/other/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ cfg_if! {
309309
}
310310
}
311311

312+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
312313
pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
313314

314315
pub const __UT_LINESIZE: usize = 32;

src/unix/notbsd/linux/s390x/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ cfg_if! {
353353
}
354354
}
355355

356+
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
356357
pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
357358

358359
pub const SFD_CLOEXEC: ::c_int = 0x080000;

src/unix/notbsd/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,6 @@ pub const MADV_NOHUGEPAGE: ::c_int = 15;
643643
pub const MADV_DONTDUMP: ::c_int = 16;
644644
pub const MADV_DODUMP: ::c_int = 17;
645645
pub const MADV_HWPOISON: ::c_int = 100;
646-
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
647646

648647
pub const IFF_UP: ::c_int = 0x1;
649648
pub const IFF_BROADCAST: ::c_int = 0x2;

0 commit comments

Comments
 (0)