summaryrefslogtreecommitdiff
path: root/src/sys/mman.rs
diff options
context:
space:
mode:
authorAl Hoang <3811822-hoanga@users.noreply.gitlab.com>2022-04-22 23:56:51 -0500
committerAl Hoang <3811822-hoanga@users.noreply.gitlab.com>2022-05-14 18:45:18 -0500
commitd02e27476cbf23b6818e57e017fd6148a98b7a92 (patch)
tree2e8bfe3a60c65393dd35224fe20bd3be51a77308 /src/sys/mman.rs
parent69738c0fd03af19053c5701a984f923ecbbfada6 (diff)
downloadnix-d02e27476cbf23b6818e57e017fd6148a98b7a92.zip
add haiku support
* enabled as much functionality and defines that match updated libc definitions for haiku
Diffstat (limited to 'src/sys/mman.rs')
-rw-r--r--src/sys/mman.rs3
1 files changed, 3 insertions, 0 deletions
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)
}