From b20ecccc48b1cec4bf038992dabc23037cb4c2f8 Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Fri, 1 Dec 2023 20:56:03 +0800 Subject: [PATCH] MAP_HUGE_SHIFT & HUGETLB_FLAG_ENCODE_SHIFT for Andorid/Fuchsia --- libc-test/semver/android.txt | 2 ++ libc-test/semver/fuchsia.txt | 2 ++ src/fuchsia/mod.rs | 3 +++ src/unix/linux_like/android/mod.rs | 2 ++ 4 files changed, 9 insertions(+) diff --git a/libc-test/semver/android.txt b/libc-test/semver/android.txt index b6fbc7578388d..a7c235eefb3ed 100644 --- a/libc-test/semver/android.txt +++ b/libc-test/semver/android.txt @@ -3766,3 +3766,5 @@ dirname basename eventfd_read eventfd_write +HUGETLB_FLAG_ENCODE_SHIFT +MAP_HUGE_SHIFT diff --git a/libc-test/semver/fuchsia.txt b/libc-test/semver/fuchsia.txt index cf3c4a10d63e1..c876cc6a5b812 100644 --- a/libc-test/semver/fuchsia.txt +++ b/libc-test/semver/fuchsia.txt @@ -1472,3 +1472,5 @@ utimensat vhangup vmsplice waitid +HUGETLB_FLAG_ENCODE_SHIFT +MAP_HUGE_SHIFT diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index 7e76db6f1f7d5..25124e6e0fcf8 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -3233,6 +3233,9 @@ pub const O_DIRECT: ::c_int = 0x00000800; pub const O_LARGEFILE: ::c_int = 0x00001000; pub const O_NOFOLLOW: ::c_int = 0x00000080; +pub const HUGETLB_FLAG_ENCODE_SHIFT: u32 = 26; +pub const MAP_HUGE_SHIFT: u32 = 26; + // intentionally not public, only used for fd_set cfg_if! { if #[cfg(target_pointer_width = "32")] { diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index c27044f0e5dde..999a15440d12c 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3320,6 +3320,8 @@ pub const NET_SCTP: ::c_int = 17; pub const NET_LLC: ::c_int = 18; pub const NET_NETFILTER: ::c_int = 19; pub const NET_DCCP: ::c_int = 20; +pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26; +pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT; // Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the // following are only available on newer Linux versions than the versions