From: Niels Sascha Reedijk Date: Sun, 25 Sep 2016 04:41:29 +0000 (-0500) Subject: Haiku: Work around the lack of the FIOCLEX ioctl X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=783ab7766faedb4117059a9be252df22b1fedcb5;p=rust.git Haiku: Work around the lack of the FIOCLEX ioctl * Hand rebased from Niels original work on 1.9.0 --- 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 @@ pub fn write(&self, buf: &[u8]) -> io::Result { 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))?;