From 40a4d331c7fdacd1d7e20101b4e5cdedc566b53b Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 4 Dec 2024 22:09:51 +0000 Subject: [PATCH] Adding MAP_DROPPABLE for Linux (6.11) ref: https://github.com/torvalds/linux/blob/feffde684ac29a3b7aec82d2df850fbdbdee55e4/include/uapi/linux/mman.h#L20 --- libc-test/build.rs | 3 +++ libc-test/semver/linux.txt | 1 + src/unix/linux_like/linux/mod.rs | 1 + 3 files changed, 5 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 2927837976f9..a384cddfb71d 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4246,6 +4246,9 @@ fn test_linux(target: &str) { "EPIOCSPARAMS" | "EPIOCGPARAMS" => true, + // FIXME: Requires >= 6.11 kernel headers. + "MAP_DROPPABLE" => true, + _ => false, } }); diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index f658187fbca9..5d2bdf61d02a 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -1586,6 +1586,7 @@ MADV_UNMERGEABLE MADV_WILLNEED MADV_WIPEONFORK MAP_DENYWRITE +MAP_DROPPABLE MAP_EXECUTABLE MAP_FILE MAP_FIXED_NOREPLACE diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index eb24e71b60ba..0a958b4f6b4c 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -4767,6 +4767,7 @@ pub const UDP_NO_CHECK6_RX: c_int = 102; // include/uapi/linux/mman.h pub const MAP_SHARED_VALIDATE: c_int = 0x3; +pub const MAP_DROPPABLE: c_int = 0x8; // include/uapi/asm-generic/mman-common.h pub const MAP_FIXED_NOREPLACE: c_int = 0x100000;