summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid CARLIER <devnexen@gmail.com>2023-03-25 17:38:48 +0000
committerDavid CARLIER <devnexen@gmail.com>2023-04-04 21:05:54 +0100
commite6c1c657cb83a11bfc119dab5d458b8699dbe6f9 (patch)
tree9eea8a4ccf26ff49ef4751027cc52954fd21700f
parentb9f037292b144a416a454ca457c6d6f94662a59e (diff)
downloadrust-libc-e6c1c657cb83a11bfc119dab5d458b8699dbe6f9.tar.gz
freebsd add MAP_ALIGNED macro
-rw-r--r--libc-test/semver/freebsd.txt2
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs12
2 files changed, 14 insertions, 0 deletions
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index eadb4e9c73..5776e8a421 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -705,6 +705,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 55b520faab..2ee676d973 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -4670,6 +4670,18 @@ pub const SCTP_ASSOC_RESET_FAILED: ::c_int = 0x0008;
pub const SCTP_STREAM_CHANGE_DENIED: ::c_int = 0x0004;
pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008;
+cfg_if! {
+ if #[cfg(libc_const_extern_fn)] {
+ pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
+ a << 24
+ }
+ } else {
+ pub fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
+ a << 24
+ }
+ }
+}
+
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES