Browse Source

Stub out set_cloexec

pull/10/head
Fenrir 7 years ago committed by FenrirWolf
parent
commit
48ee173596
  1. 28
      ctr-std/src/sys/unix/fd.rs

28
ctr-std/src/sys/unix/fd.rs

@ -110,33 +110,9 @@ impl FileDesc { @@ -110,33 +110,9 @@ impl FileDesc {
}
}
#[cfg(not(any(target_env = "newlib",
target_os = "solaris",
target_os = "emscripten",
target_os = "fuchsia",
target_os = "l4re",
target_os = "haiku")))]
// We don't have fork/exec on the 3DS, so this shouldn't need to do anything
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",
target_os = "fuchsia",
target_os = "l4re",
target_os = "haiku"))]
pub fn set_cloexec(&self) -> io::Result<()> {
unsafe {
let previous = cvt(libc::fcntl(self.fd, libc::F_GETFD))?;
let new = previous | libc::FD_CLOEXEC;
if new != previous {
cvt(libc::fcntl(self.fd, libc::F_SETFD, new))?;
}
Ok(())
}
Ok(())
}
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {

Loading…
Cancel
Save