summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorNiels Sascha Reedijk <niels.reedijk@gmail.com>2016-09-24 23:38:56 -0500
committerAlexander von Gluck IV <kallisti5@unixzen.com>2016-09-25 11:12:23 -0500
commit1a6fc8b7b840fb381b1aefa35b9b3d4c736bae50 (patch)
tree0e05d41032bc801ce69ce359645da9a437260469 /src/librustc_data_structures
parent2d1d4d199471dbdf0828acbc06cfe452463569af (diff)
downloadrust-1a6fc8b7b840fb381b1aefa35b9b3d4c736bae50.tar.gz
rust-1a6fc8b7b840fb381b1aefa35b9b3d4c736bae50.zip
Add support for the Haiku operating system on x86 and x86_64 machines
* Hand rebased from Niels original work on 1.9.0
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/flock.rs21
1 files changed, 21 insertions, 0 deletions
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;