From 1a6fc8b7b840fb381b1aefa35b9b3d4c736bae50 Mon Sep 17 00:00:00 2001 From: Niels Sascha Reedijk Date: Sat, 24 Sep 2016 23:38:56 -0500 Subject: Add support for the Haiku operating system on x86 and x86_64 machines * Hand rebased from Niels original work on 1.9.0 --- src/librustc_data_structures/flock.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/librustc_data_structures') diff --git a/src/librustc_data_structures/flock.rs b/src/librustc_data_structures/flock.rs index 4a184d3174d..510c9ceef09 100644 --- a/src/librustc_data_structures/flock.rs +++ b/src/librustc_data_structures/flock.rs @@ -94,6 +94,27 @@ mod imp { pub const F_SETLKW: libc::c_int = 9; } + #[cfg(target_os = "haiku")] + mod os { + use libc; + + pub struct flock { + pub l_type: libc::c_short, + pub l_whence: libc::c_short, + pub l_start: libc::off_t, + pub l_len: libc::off_t, + pub l_pid: libc::pid_t, + + // not actually here, but brings in line with freebsd + pub l_sysid: libc::c_int, + } + + pub const F_UNLCK: libc::c_short = 0x0200; + pub const F_WRLCK: libc::c_short = 0x0400; + pub const F_SETLK: libc::c_int = 0x0080; + pub const F_SETLKW: libc::c_int = 0x0100; + } + #[cfg(any(target_os = "macos", target_os = "ios"))] mod os { use libc; -- cgit 1.4.1-3-g733a5