(fd: BorrowedFd<'_>)
| 131 | |
| 132 | #[inline] |
| 133 | pub(crate) fn accept(fd: BorrowedFd<'_>) -> io::Result<OwnedFd> { |
| 134 | #[cfg(not(any(target_arch = "x86", target_arch = "s390x")))] |
| 135 | unsafe { |
| 136 | let fd = ret_owned_fd(syscall_readonly!(__NR_accept, fd, zero(), zero()))?; |
| 137 | Ok(fd) |
| 138 | } |
| 139 | #[cfg(target_arch = "x86")] |
| 140 | unsafe { |
| 141 | let fd = ret_owned_fd(syscall_readonly!( |
| 142 | __NR_socketcall, |
| 143 | x86_sys(SYS_ACCEPT), |
| 144 | slice_just_addr::<ArgReg<'_, SocketArg>, _>(&[fd.into(), zero(), zero()]) |
| 145 | ))?; |
| 146 | Ok(fd) |
| 147 | } |
| 148 | #[cfg(target_arch = "s390x")] |
| 149 | { |
| 150 | // accept is not available on s390x |
| 151 | accept_with(fd, SocketFlags::empty()) |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | #[inline] |
| 156 | pub(crate) fn accept_with(fd: BorrowedFd<'_>, flags: SocketFlags) -> io::Result<OwnedFd> { |
nothing calls this directly
no test coverage detected