()
| 16 | |
| 17 | #[inline] |
| 18 | pub(crate) fn pipe() -> io::Result<(OwnedFd, OwnedFd)> { |
| 19 | // aarch64 and risc64 omit `__NR_pipe`. On mips, `__NR_pipe` uses a special |
| 20 | // calling convention, but using it is not worth complicating our syscall |
| 21 | // wrapping infrastructure at this time. |
| 22 | #[cfg(any( |
| 23 | target_arch = "aarch64", |
| 24 | target_arch = "mips", |
| 25 | target_arch = "mips32r6", |
| 26 | target_arch = "mips64", |
| 27 | target_arch = "mips64r6", |
| 28 | target_arch = "riscv64", |
| 29 | ))] |
| 30 | { |
| 31 | pipe_with(PipeFlags::empty()) |
| 32 | } |
| 33 | #[cfg(not(any( |
| 34 | target_arch = "aarch64", |
| 35 | target_arch = "mips", |
| 36 | target_arch = "mips32r6", |
| 37 | target_arch = "mips64", |
| 38 | target_arch = "mips64r6", |
| 39 | target_arch = "riscv64", |
| 40 | )))] |
| 41 | unsafe { |
| 42 | let mut result = MaybeUninit::<[OwnedFd; 2]>::uninit(); |
| 43 | ret(syscall!(__NR_pipe, &mut result))?; |
| 44 | let [p0, p1] = result.assume_init(); |
| 45 | Ok((p0, p1)) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | #[inline] |
| 50 | pub(crate) fn pipe_with(flags: PipeFlags) -> io::Result<(OwnedFd, OwnedFd)> { |
nothing calls this directly
no test coverage detected