summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc-test/semver/netbsd.txt1
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs13
2 files changed, 14 insertions, 0 deletions
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index 3dc84da635..b8fd4a194c 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -628,6 +628,7 @@ MADV_NORMAL
MADV_RANDOM
MADV_SEQUENTIAL
MADV_WILLNEED
+MAP_ALIGNED
MAP_ALIGNMENT_16MB
MAP_ALIGNMENT_1TB
MAP_ALIGNMENT_256TB
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