about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorNiels Sascha Reedijk <niels.reedijk@gmail.com>2016-09-24 23:41:29 -0500
committerAlexander von Gluck IV <kallisti5@unixzen.com>2016-09-25 11:13:57 -0500
commit783ab7766faedb4117059a9be252df22b1fedcb5 (patch)
treebde574d4dd5b8a3992524c888aafb07d82d8a6f9 /src/libstd/sys
parent1a6fc8b7b840fb381b1aefa35b9b3d4c736bae50 (diff)
downloadrust-783ab7766faedb4117059a9be252df22b1fedcb5.tar.gz
rust-783ab7766faedb4117059a9be252df22b1fedcb5.zip
Haiku: Work around the lack of the FIOCLEX ioctl
* Hand rebased from Niels original work on 1.9.0
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/fd.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstd/sys/unix/fd.rs b/src/libstd/sys/unix/fd.rs
index 8bca6d469b7..60c1750b469 100644
--- a/src/libstd/sys/unix/fd.rs
+++ b/src/libstd/sys/unix/fd.rs
@@ -59,14 +59,20 @@ impl FileDesc {
         Ok(ret as usize)
     }
 
-    #[cfg(not(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten")))]
+    #[cfg(not(any(target_env = "newlib",
+                  target_os = "solaris",
+                  target_os = "emscripten",
+                  target_os = "haiku")))]
     pub fn set_cloexec(&self) -> io::Result<()> {
         unsafe {
             cvt(libc::ioctl(self.fd, libc::FIOCLEX))?;
             Ok(())
         }
     }
-    #[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
+    #[cfg(any(target_env = "newlib",
+              target_os = "solaris",
+              target_os = "emscripten",
+              target_os = "haiku"))]
     pub fn set_cloexec(&self) -> io::Result<()> {
         unsafe {
             let previous = cvt(libc::fcntl(self.fd, libc::F_GETFD))?;