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..79a4bef8bafd6 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -2664,7 +2664,7 @@ pub const Q_SETQUOTA: ::c_int = 0x800; pub const MAP_GUARD: ::c_int = 0x00002000; pub const MAP_EXCL: ::c_int = 0x00004000; pub const MAP_PREFAULT_READ: ::c_int = 0x00040000; -pub const MAP_ALIGNED_SUPER: ::c_int = 1 << 24; +pub const MAP_ALIGNED_SUPER: ::c_int = MAP_ALIGNED(1); pub const POSIX_FADV_NORMAL: ::c_int = 0; pub const POSIX_FADV_RANDOM: ::c_int = 1; @@ -4813,6 +4813,10 @@ safe_f! { pub {const} fn PR_SCTP_VALID_POLICY(x: ::c_int) -> bool { PR_SCTP_POLICY(x) <= SCTP_PR_SCTP_MAX } + + pub {const} fn MAP_ALIGNED(a: ::c_int) -> ::c_int { + a << 24 + } } cfg_if! {