diff options
author | David Carlier <devnexen@gmail.com> | 2023-03-26 17:07:19 +0100 |
---|---|---|
committer | David CARLIER <devnexen@gmail.com> | 2023-04-04 21:09:25 +0100 |
commit | b9f3f0a60810fd99dd8d641d2b86d4dba573c52e (patch) | |
tree | 6acf77298887e8f9e0b8a6cb0ae98169ae87ce59 /src/unix/bsd/netbsdlike/netbsd/mod.rs | |
parent | b9f037292b144a416a454ca457c6d6f94662a59e (diff) | |
download | rust-libc-b9f3f0a60810fd99dd8d641d2b86d4dba573c52e.tar.gz |
netbsd add MAP_ALIGNED macro
Diffstat (limited to 'src/unix/bsd/netbsdlike/netbsd/mod.rs')
-rw-r--r-- | src/unix/bsd/netbsdlike/netbsd/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index fd7175583e..b100b3e142 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -2384,6 +2384,19 @@ pub const GRND_NONBLOCK: ::c_uint = 0x1; pub const GRND_RANDOM: ::c_uint = 0x2; pub const GRND_INSECURE: ::c_uint = 0x4; +cfg_if! { + + if #[cfg(libc_const_extern_fn)] { + pub const fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int { + alignment << MAP_ALIGNMENT_SHIFT + } + } else { + pub fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int { + alignment << MAP_ALIGNMENT_SHIFT + } + } +} + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES |