summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc-test/Cargo.toml2
-rw-r--r--libc-test/build.rs15
-rw-r--r--libc-test/semver/linux.txt7
-rw-r--r--libc-test/semver/netbsd.txt2
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs10
-rw-r--r--src/unix/linux_like/linux/arch/generic/mod.rs10
-rw-r--r--src/unix/linux_like/linux/arch/mips/mod.rs3
-rw-r--r--src/unix/linux_like/linux/arch/powerpc/mod.rs3
-rw-r--r--src/unix/linux_like/mod.rs11
9 files changed, 53 insertions, 10 deletions
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 212938b23d..83bfcba9c6 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -12,7 +12,7 @@ A test crate for the libc crate.
[dependencies.libc]
path = ".."
-version = "0.2.122"
+version = "0.2.142"
default-features = false
[build-dependencies]
diff --git a/libc-test/build.rs b/libc-test/build.rs
index ac0f996fc4..85536110cf 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1788,6 +1788,14 @@ fn test_android(target: &str) {
// kernel 5.10 minimum required
"MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ" | "MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ" => true,
+ // kernel 5.18 minimum
+ | "MADV_COLD"
+ | "MADV_DONTNEED_LOCKED"
+ | "MADV_PAGEOUT"
+ | "MADV_POPULATE_READ"
+ | "MADV_POPULATE_WRITE" => true,
+
+
_ => false,
}
});
@@ -3714,6 +3722,12 @@ fn test_linux(target: &str) {
// Added in Linux 5.13
"PTRACE_GET_RSEQ_CONFIGURATION" if sparc64 => true,
+ | "MADV_COLD"
+ | "MADV_PAGEOUT"
+ | "MADV_POPULATE_READ"
+ | "MADV_POPULATE_WRITE"
+ if sparc64 || musl => true,
+
// FIXME: Requires more recent kernel headers
| "IFLA_PARENT_DEV_NAME" // linux v5.13+
| "IFLA_PARENT_DEV_BUS_NAME" // linux v5.13+
@@ -3721,6 +3735,7 @@ fn test_linux(target: &str) {
| "IFLA_TSO_MAX_SIZE" // linux v5.18+
| "IFLA_TSO_MAX_SEGS" // linux v5.18+
| "IFLA_ALLMULTI" // linux v6.0+
+ | "MADV_DONTNEED_LOCKED" // linux v5.18+
=> true,
"SCTP_FUTURE_ASSOC" | "SCTP_CURRENT_ASSOC" | "SCTP_ALL_ASSOC" | "SCTP_PEER_ADDR_THLDS_V2" => true, // linux 5.5+
diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt
index 27bd9accc2..4e9ff8d420 100644
--- a/libc-test/semver/linux.txt
+++ b/libc-test/semver/linux.txt
@@ -1286,22 +1286,29 @@ LOG_FTP
LOG_NFACILITIES
LOG_PERROR
L_tmpnam
+MADV_COLD
MADV_DODUMP
MADV_DOFORK
MADV_DONTDUMP
MADV_DONTFORK
MADV_DONTNEED
+MADV_DONTNEED_LOCKED
MADV_FREE
MADV_HUGEPAGE
MADV_HWPOISON
+MADV_KEEPONFORK
MADV_MERGEABLE
MADV_NOHUGEPAGE
MADV_NORMAL
+MADV_PAGEOUT
+MADV_POPULATE_READ
+MADV_POPULATE_WRITE
MADV_RANDOM
MADV_REMOVE
MADV_SEQUENTIAL
MADV_UNMERGEABLE
MADV_WILLNEED
+MADV_WIPEONFORK
MAP_DENYWRITE
MAP_EXECUTABLE
MAP_FILE
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 1ae531f55a..6dd75bde86 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -1567,3 +1567,5 @@ EXTATTR_NAMESPACE_EMPTY
extattr_list_fd
extattr_list_file
extattr_list_link
+EOWNERDEAD
+ENOTRECOVERABLE
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 402257fd3b..c750cfb1d0 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -1464,7 +1464,15 @@ pub const ENOATTR: ::c_int = 93;
pub const EMULTIHOP: ::c_int = 94;
pub const ENOLINK: ::c_int = 95;
pub const EPROTO: ::c_int = 96;
-pub const ELAST: ::c_int = 96;
+pub const EOWNERDEAD: ::c_int = 97;
+pub const ENOTRECOVERABLE: ::c_int = 98;
+#[deprecated(
+ since = "0.2.143",
+ note = "This value will always match the highest defined error number \
+ and thus is not stable. \
+ See #3040 for more info."
+)]
+pub const ELAST: ::c_int = 98;
pub const F_DUPFD_CLOEXEC: ::c_int = 12;
pub const F_CLOSEM: ::c_int = 10;
diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs
index 4693978311..8acf5b5520 100644
--- a/src/unix/linux_like/linux/arch/generic/mod.rs
+++ b/src/unix/linux_like/linux/arch/generic/mod.rs
@@ -104,6 +104,8 @@ cfg_if! {
pub const SO_DETACH_REUSEPORT_BPF: ::c_int = 68;
}
}
+// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
+// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
cfg_if! {
if #[cfg(any(target_arch = "x86",
@@ -114,16 +116,8 @@ cfg_if! {
target_arch = "s390x"))] {
pub const FICLONE: ::c_ulong = 0x40049409;
pub const FICLONERANGE: ::c_ulong = 0x4020940D;
- } else if #[cfg(any(target_arch = "mips",
- target_arch = "mips64",
- target_arch = "powerpc",
- target_arch = "powerpc64"))] {
- pub const FICLONE: ::c_ulong = 0x80049409;
- pub const FICLONERANGE: ::c_ulong = 0x8020940D;
}
}
-// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
-// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
// Defined in unix/linux_like/mod.rs
// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs
index 077417de52..34c00a2936 100644
--- a/src/unix/linux_like/linux/arch/mips/mod.rs
+++ b/src/unix/linux_like/linux/arch/mips/mod.rs
@@ -103,6 +103,9 @@ pub const SO_TIMESTAMPING: ::c_int = 37;
// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
+pub const FICLONE: ::c_ulong = 0x80049409;
+pub const FICLONERANGE: ::c_ulong = 0x8020940D;
+
// Defined in unix/linux_like/mod.rs
// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs
index 637b7a1e34..64c3eaab54 100644
--- a/src/unix/linux_like/linux/arch/powerpc/mod.rs
+++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs
@@ -85,6 +85,9 @@ pub const SO_BINDTOIFINDEX: ::c_int = 62;
// pub const SO_PREFER_BUSY_POLL: ::c_int = 69;
// pub const SO_BUSY_POLL_BUDGET: ::c_int = 70;
+pub const FICLONE: ::c_ulong = 0x80049409;
+pub const FICLONERANGE: ::c_ulong = 0x8020940D;
+
// Defined in unix/linux_like/mod.rs
// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs
index 584e308ce2..5142ac499f 100644
--- a/src/unix/linux_like/mod.rs
+++ b/src/unix/linux_like/mod.rs
@@ -662,7 +662,18 @@ pub const MADV_HUGEPAGE: ::c_int = 14;
pub const MADV_NOHUGEPAGE: ::c_int = 15;
pub const MADV_DONTDUMP: ::c_int = 16;
pub const MADV_DODUMP: ::c_int = 17;
+pub const MADV_WIPEONFORK: ::c_int = 18;
+pub const MADV_KEEPONFORK: ::c_int = 19;
+pub const MADV_COLD: ::c_int = 20;
+pub const MADV_PAGEOUT: ::c_int = 21;
pub const MADV_HWPOISON: ::c_int = 100;
+cfg_if! {
+ if #[cfg(not(target_os = "emscripten"))] {
+ pub const MADV_POPULATE_READ: ::c_int = 22;
+ pub const MADV_POPULATE_WRITE: ::c_int = 23;
+ pub const MADV_DONTNEED_LOCKED: ::c_int = 24;
+ }
+}
pub const IFF_UP: ::c_int = 0x1;
pub const IFF_BROADCAST: ::c_int = 0x2;