Skip to content

Commit 8db0701

Browse files
authored
sys::mman adding MMAP_TRYFIXED for netbsdlike platforms. (#2260)
1 parent 43505e0 commit 8db0701

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ targets = [
2828
]
2929

3030
[dependencies]
31-
libc = { git = "https://github.com/rust-lang/libc", rev = "497ac428bc010b5db9682ecf94cd567b31d53e5c", features = ["extra_traits"] }
31+
libc = { git = "https://github.com/rust-lang/libc", rev = "f37806e499409eab8cfa897280a869bc5e2623a9", features = ["extra_traits"] }
3232
bitflags = "2.3.1"
3333
cfg-if = "1.0"
3434
pin-utils = { version = "0.1.0", optional = true }

changelog/2260.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `MmapFlags::MAP_FIXED` constant in `sys::mman` for netbsd and openbsd

src/sys/mman.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ libc_bitflags! {
154154
/// Pages will be discarded in the core dumps.
155155
#[cfg(target_os = "openbsd")]
156156
MAP_CONCEAL;
157+
/// Attempt to place the mapping at exactly the address specified in `addr`.
158+
/// it's a default behavior on OpenBSD.
159+
#[cfg(netbsdlike)]
160+
MAP_TRYFIXED;
157161
}
158162
}
159163

0 commit comments

Comments
 (0)