(
family: AddressFamily,
type_: SocketType,
protocol: Option<Protocol>,
)
| 39 | |
| 40 | #[inline] |
| 41 | pub(crate) fn socket( |
| 42 | family: AddressFamily, |
| 43 | type_: SocketType, |
| 44 | protocol: Option<Protocol>, |
| 45 | ) -> io::Result<OwnedFd> { |
| 46 | #[cfg(not(target_arch = "x86"))] |
| 47 | unsafe { |
| 48 | ret_owned_fd(syscall_readonly!(__NR_socket, family, type_, protocol)) |
| 49 | } |
| 50 | #[cfg(target_arch = "x86")] |
| 51 | unsafe { |
| 52 | ret_owned_fd(syscall_readonly!( |
| 53 | __NR_socketcall, |
| 54 | x86_sys(SYS_SOCKET), |
| 55 | slice_just_addr::<ArgReg<'_, SocketArg>, _>(&[ |
| 56 | family.into(), |
| 57 | type_.into(), |
| 58 | protocol.into(), |
| 59 | ]) |
| 60 | )) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | #[inline] |
| 65 | pub(crate) fn socket_with( |
nothing calls this directly
no test coverage detected