Haiku: Work around the lack of the FIOCLEX ioctl
* Hand rebased from Niels original work on 1.9.0
This commit is contained in:
parent
1a6fc8b7b8
commit
783ab7766f
@ -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))?;
|
||||
|
Loading…
Reference in New Issue
Block a user