Skip to content

Commit 64204ef

Browse files
author
Al Hoang
committed
haiku: enable mman
* no mlockall
1 parent 1275e36 commit 64204ef

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/sys/mman.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ libc_bitflags!{
351351
}
352352
}
353353

354+
#[cfg(not(target_os = "haiku"))]
354355
libc_bitflags!{
355356
/// Flags for [`mlockall`].
356357
pub struct MlockAllFlags: c_int {
@@ -393,6 +394,7 @@ pub unsafe fn munlock(addr: *const c_void, length: size_t) -> Result<()> {
393394
/// Locked pages never move to the swap area. For more information, see [`mlockall(2)`].
394395
///
395396
/// [`mlockall(2)`]: https://man7.org/linux/man-pages/man2/mlockall.2.html
397+
#[cfg(not(target_os = "haiku"))]
396398
pub fn mlockall(flags: MlockAllFlags) -> Result<()> {
397399
unsafe { Errno::result(libc::mlockall(flags.bits())) }.map(drop)
398400
}

src/sys/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ feature! {
5252
pub mod memfd;
5353
}
5454

55-
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
55+
#[cfg(not(any(target_os = "redox")))]
5656
feature! {
5757
#![feature = "mman"]
5858
pub mod mman;

test/sys/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mod test_signal;
1111
target_os = "macos",
1212
target_os = "netbsd"))]
1313
mod test_aio;
14-
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
14+
#[cfg(not(any(target_os = "redox")))]
1515
mod test_mman;
1616
#[cfg(target_os = "linux")]
1717
mod test_signalfd;

0 commit comments

Comments
 (0)