From 2798840ee31c77f6f77173cf1df81f03b0b15885 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 2 Apr 2022 18:24:44 +0100 Subject: [PATCH] Adds to PR_SET_VMA/PR_SET_VMA_ANON_NAME to Linux. --- libc-test/build.rs | 2 ++ libc-test/semver/linux-gnu.txt | 2 ++ libc-test/semver/linux-musl.txt | 2 ++ src/unix/linux_like/linux/mod.rs | 3 +++ 4 files changed, 9 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index ceb3c0a313d27..27497fa718957 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -3314,6 +3314,8 @@ fn test_linux(target: &str) { "FUSE_SUPER_MAGIC" => true, // linux 5.12 min "MPOL_F_NUMA_BALANCING" => true, + // linux 5.17 min + "PR_SET_VMA" | "PR_SET_VMA_ANON_NAME" => true, _ => false, } diff --git a/libc-test/semver/linux-gnu.txt b/libc-test/semver/linux-gnu.txt index 7a65d3645c591..c7ef8ef358694 100644 --- a/libc-test/semver/linux-gnu.txt +++ b/libc-test/semver/linux-gnu.txt @@ -356,6 +356,8 @@ O_FSYNC PF_IB PF_MPLS PF_XDP +PR_SET_VMA +PR_SET_VMA_ANON_NAME PROC_SUPER_MAGIC PTHREAD_MUTEX_ADAPTIVE_NP PTRACE_GET_SYSCALL_INFO diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index 86bda6150d29d..764ee79060c3a 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -20,6 +20,8 @@ LIO_WRITE PF_IB PF_MPLS PF_XDP +PR_SET_VMA +PR_SET_VMA_ANON_NAME adjtimex aio_cancel aio_error diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index bbc76f5daad63..64d293e2c8567 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -1776,6 +1776,9 @@ pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2; pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3; pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4; +pub const PR_SET_VMA: ::c_int = 0x53564d41; +pub const PR_SET_VMA_ANON_NAME: ::c_int = 0; + pub const GRND_NONBLOCK: ::c_uint = 0x0001; pub const GRND_RANDOM: ::c_uint = 0x0002;