From 4bebf9d6897e15cc087dc7ff0731499394fb4504 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sat, 25 Mar 2023 17:38:48 +0000 Subject: [PATCH] freebsd add MAP_ALIGNED macro --- libc-test/semver/freebsd.txt | 2 ++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 429ae63eb8d31..310841d9bbcdc 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -702,6 +702,8 @@ MALLOCX_ARENA MALLOCX_ALIGN MALLOCX_TCACHE MALLOCX_ZERO +MAP_ALIGNED +MAP_ALIGNED_SUPER MAP_COPY MAP_EXCL MAP_FILE diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index b70a40f15d2c6..6ae82b8d87f79 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -4698,6 +4698,9 @@ f! { as ::c_uint } + pub {const} fn MAP_ALIGNED(a: ::c_int) -> ::c_int { + a << 24 + } pub fn MALLOCX_ALIGN(lg: ::c_uint) -> ::c_int { ffsl(lg as ::c_long - 1) }