From d02e27476cbf23b6818e57e017fd6148a98b7a92 Mon Sep 17 00:00:00 2001 From: Al Hoang <3811822-hoanga@users.noreply.gitlab.com> Date: Fri, 22 Apr 2022 23:56:51 -0500 Subject: add haiku support * enabled as much functionality and defines that match updated libc definitions for haiku --- src/sys/mman.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sys/mman.rs') diff --git a/src/sys/mman.rs b/src/sys/mman.rs index a7469a17..700e231c 100644 --- a/src/sys/mman.rs +++ b/src/sys/mman.rs @@ -351,6 +351,7 @@ libc_bitflags!{ } } +#[cfg(not(target_os = "haiku"))] libc_bitflags!{ /// Flags for [`mlockall`]. pub struct MlockAllFlags: c_int { @@ -393,6 +394,7 @@ pub unsafe fn munlock(addr: *const c_void, length: size_t) -> Result<()> { /// Locked pages never move to the swap area. For more information, see [`mlockall(2)`]. /// /// [`mlockall(2)`]: https://man7.org/linux/man-pages/man2/mlockall.2.html +#[cfg(not(target_os = "haiku"))] pub fn mlockall(flags: MlockAllFlags) -> Result<()> { unsafe { Errno::result(libc::mlockall(flags.bits())) }.map(drop) } @@ -402,6 +404,7 @@ pub fn mlockall(flags: MlockAllFlags) -> Result<()> { /// For more information, see [`munlockall(2)`]. /// /// [`munlockall(2)`]: https://man7.org/linux/man-pages/man2/munlockall.2.html +#[cfg(not(target_os = "haiku"))] pub fn munlockall() -> Result<()> { unsafe { Errno::result(libc::munlockall()) }.map(drop) } -- cgit v1.2.3