summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-11-06 10:22:20 +0000
committerbors <bors@rust-lang.org>2021-11-06 10:22:20 +0000
commita06f6bcf5db9695388e30e25d24113f04a78dbcd (patch)
tree208cf5a67e32121bbbbbe8f6bcf4a0932d269006
parentb916b48d6823187b20ef0b2ee4cdb8c256adfb73 (diff)
parent31a3d160d46e66152538ce8c396dd3ec3e0a1f10 (diff)
downloadrust-libc-a06f6bcf5db9695388e30e25d24113f04a78dbcd.tar.gz
Auto merge of #2516 - devnexen:mmap_align_aliases, r=JohnTitor
netbsd add MAP_ALIGNED aliases
-rw-r--r--libc-test/semver/netbsd.txt8
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs9
2 files changed, 17 insertions, 0 deletions
diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt
index b58ddd4e06..cc1f29bbc2 100644
--- a/libc-test/semver/netbsd.txt
+++ b/libc-test/semver/netbsd.txt
@@ -596,6 +596,14 @@ MADV_NORMAL
MADV_RANDOM
MADV_SEQUENTIAL
MADV_WILLNEED
+MAP_ALIGNMENT_16MB
+MAP_ALIGNMENT_1TB
+MAP_ALIGNMENT_256TB
+MAP_ALIGNMENT_4GB
+MAP_ALIGNMENT_64KB
+MAP_ALIGNMENT_64PB
+MAP_ALIGNMENT_MASK
+MAP_ALIGNMENT_SHIFT
MAP_FILE
MAP_HASSEMAPHORE
MAP_NORESERVE
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 678402f4a8..6b9adaa564 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -1395,6 +1395,15 @@ pub const MAP_NORESERVE: ::c_int = 0x40;
pub const MAP_HASSEMAPHORE: ::c_int = 0x200;
pub const MAP_WIRED: ::c_int = 0x800;
pub const MAP_STACK: ::c_int = 0x2000;
+// map alignment aliases for MAP_ALIGNED
+pub const MAP_ALIGNMENT_SHIFT: ::c_int = 24;
+pub const MAP_ALIGNMENT_MASK: ::c_int = 0xff << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_64KB: ::c_int = 16 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_16MB: ::c_int = 24 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_4GB: ::c_int = 32 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_1TB: ::c_int = 40 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_256TB: ::c_int = 48 << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNMENT_64PB: ::c_int = 56 << MAP_ALIGNMENT_SHIFT;
// mremap flag
pub const MAP_REMAPDUP: ::c_int = 0x004;