From 783ab7766faedb4117059a9be252df22b1fedcb5 Mon Sep 17 00:00:00 2001 From: Niels Sascha Reedijk Date: Sat, 24 Sep 2016 23:41:29 -0500 Subject: [PATCH] Haiku: Work around the lack of the FIOCLEX ioctl * Hand rebased from Niels original work on 1.9.0 --- src/libstd/sys/unix/fd.rs | 10 ++++++++-- 1 file 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 @@ 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))?; -- 2.44.0