Skip to content

Commit 783ab77

Browse files
nielxkallisti5
authored andcommitted
Haiku: Work around the lack of the FIOCLEX ioctl
* Hand rebased from Niels original work on 1.9.0
1 parent 1a6fc8b commit 783ab77

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/libstd/sys/unix/fd.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,20 @@ impl FileDesc {
5959
Ok(ret as usize)
6060
}
6161

62-
#[cfg(not(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten")))]
62+
#[cfg(not(any(target_env = "newlib",
63+
target_os = "solaris",
64+
target_os = "emscripten",
65+
target_os = "haiku")))]
6366
pub fn set_cloexec(&self) -> io::Result<()> {
6467
unsafe {
6568
cvt(libc::ioctl(self.fd, libc::FIOCLEX))?;
6669
Ok(())
6770
}
6871
}
69-
#[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
72+
#[cfg(any(target_env = "newlib",
73+
target_os = "solaris",
74+
target_os = "emscripten",
75+
target_os = "haiku"))]
7076
pub fn set_cloexec(&self) -> io::Result<()> {
7177
unsafe {
7278
let previous = cvt(libc::fcntl(self.fd, libc::F_GETFD))?;

0 commit comments

Comments
 (0)