Skip to content

Commit 56a74a6

Browse files
committed
Auto merge of #3167 - devnexen:fbsd_map_aligned, r=JohnTitor
freebsd add MAP_ALIGNED macro
2 parents 2d2d74c + e6c1c65 commit 56a74a6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libc-test/semver/freebsd.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,8 @@ MALLOCX_ARENA
705705
MALLOCX_ALIGN
706706
MALLOCX_TCACHE
707707
MALLOCX_ZERO
708+
MAP_ALIGNED
709+
MAP_ALIGNED_SUPER
708710
MAP_COPY
709711
MAP_EXCL
710712
MAP_FILE

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4670,6 +4670,18 @@ pub const SCTP_ASSOC_RESET_FAILED: ::c_int = 0x0008;
46704670
pub const SCTP_STREAM_CHANGE_DENIED: ::c_int = 0x0004;
46714671
pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008;
46724672

4673+
cfg_if! {
4674+
if #[cfg(libc_const_extern_fn)] {
4675+
pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
4676+
a << 24
4677+
}
4678+
} else {
4679+
pub fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
4680+
a << 24
4681+
}
4682+
}
4683+
}
4684+
46734685
const_fn! {
46744686
{const} fn _ALIGN(p: usize) -> usize {
46754687
(p + _ALIGNBYTES) & !_ALIGNBYTES

0 commit comments

Comments
 (0)