Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ use std::os::unix::prelude::*;
// we can do is call pipe() followed by fcntl(), and hope that no other threads
// fork() in between. The following code is copied from the nix crate, where it
// works but is deprecated.
#[cfg(not(any(
target_os = "aix",
target_os = "ios",
target_os = "visionos",
target_os = "macos",
target_os = "haiku"
)))]
#[cfg(not(any(target_os = "aix", target_vendor = "apple", target_os = "haiku")))]
fn pipe2_cloexec() -> io::Result<(OwnedFd, OwnedFd)> {
let mut fds: [c_int; 2] = [0; 2];
let res = unsafe { libc::pipe2(fds.as_mut_ptr(), libc::O_CLOEXEC) };
Expand All @@ -26,13 +20,7 @@ fn pipe2_cloexec() -> io::Result<(OwnedFd, OwnedFd)> {
unsafe { Ok((OwnedFd::from_raw_fd(fds[0]), OwnedFd::from_raw_fd(fds[1]))) }
}

#[cfg(any(
target_os = "aix",
target_os = "ios",
target_os = "visionos",
target_os = "macos",
target_os = "haiku"
))]
#[cfg(any(target_os = "aix", target_vendor = "apple", target_os = "haiku"))]
fn pipe2_cloexec() -> io::Result<(OwnedFd, OwnedFd)> {
let mut fds: [c_int; 2] = [0; 2];
let res = unsafe { libc::pipe(fds.as_mut_ptr()) };
Expand Down