summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc-test/build.rs8
-rw-r--r--libc-test/semver/freebsd.txt2
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs3
-rw-r--r--src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs7
4 files changed, 18 insertions, 2 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index ea7db1a503..d05672a47e 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -2078,7 +2078,9 @@ fn test_freebsd(target: &str) {
"O_RESOLVE_BENEATH" if Some(12) > freebsd_ver => true,
// These constants were introduced in FreeBSD 13:
- "O_DSYNC" | "O_PATH" | "O_EMPTY_PATH" if Some(13) > freebsd_ver => true,
+ "O_DSYNC" | "O_PATH" | "O_EMPTY_PATH" | "AT_EMPTY_PATH" if Some(13) > freebsd_ver => {
+ true
+ }
// FIXME: These are deprecated - remove in a couple of releases.
// These constants were removed in FreeBSD 11 (svn r273250) but will
@@ -3586,8 +3588,10 @@ fn test_linux(target: &str) {
// present in recent kernels only
"PR_SCHED_CORE" | "PR_SCHED_CORE_CREATE" | "PR_SCHED_CORE_GET" | "PR_SCHED_CORE_MAX" | "PR_SCHED_CORE_SCOPE_PROCESS_GROUP" | "PR_SCHED_CORE_SCOPE_THREAD" | "PR_SCHED_CORE_SCOPE_THREAD_GROUP" | "PR_SCHED_CORE_SHARE_FROM" | "PR_SCHED_CORE_SHARE_TO" => true,
- // present in recent kernels only
+ // present in recent kernels only >= 5.13
"PR_PAC_SET_ENABLED_KEYS" | "PR_PAC_GET_ENABLED_KEYS" => true,
+ // present in recent kernels only >= 5.19
+ "PR_SME_SET_VL" | "PR_SME_GET_VL" | "PR_SME_VL_LEN_MAX" | "PR_SME_SET_VL_INHERIT" | "PR_SME_SET_VL_ONE_EXEC" => true,
// Added in Linux 5.14
"FUTEX_LOCK_PI2" => true,
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index 91b2ce33a5..33442a4b11 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -86,6 +86,7 @@ ATF_USETRAILERS
AT_BASE
AT_EACCESS
AT_EGID
+AT_EMPTY_PATH
AT_ENTRY
AT_EUID
AT_EXECPATH
@@ -2134,6 +2135,7 @@ stack_t
statfs
strcasecmp
strcasestr
+strchrnul
strncasecmp
strndup
strsignal
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 2947528f78..e69c32ad9e 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -3737,6 +3737,7 @@ pub const AT_EACCESS: ::c_int = 0x100;
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
pub const AT_REMOVEDIR: ::c_int = 0x800;
+pub const AT_EMPTY_PATH: ::c_int = 0x4000;
pub const AT_NULL: ::c_int = 0;
pub const AT_IGNORE: ::c_int = 1;
@@ -5273,6 +5274,8 @@ extern "C" {
rmtp: *mut ::timespec,
) -> ::c_int;
+ pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;
+
pub fn shm_create_largepage(
path: *const ::c_char,
flags: ::c_int,
diff --git a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
index a20a1cf688..f46ea941b9 100644
--- a/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
+++ b/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
@@ -590,6 +590,13 @@ pub const PR_PAC_APDAKEY: ::c_ulong = 1 << 2;
pub const PR_PAC_APDBKEY: ::c_ulong = 1 << 3;
pub const PR_PAC_APGAKEY: ::c_ulong = 1 << 4;
+pub const PR_SME_SET_VL: ::c_int = 63;
+pub const PR_SME_GET_VL: ::c_int = 64;
+pub const PR_SME_VL_LEN_MAX: ::c_int = 0xffff;
+
+pub const PR_SME_SET_VL_INHERIT: ::c_ulong = 1 << 17;
+pub const PR_SME_SET_VL_ONE_EXEC: ::c_ulong = 1 << 18;
+
// Syscall table
pub const SYS_io_setup: ::c_long = 0;
pub const SYS_io_destroy: ::c_long = 1;