1b8a62b91Sopenharmony_ciuse crate::fd::OwnedFd; 2b8a62b91Sopenharmony_ciuse crate::net::{AddressFamily, Protocol, SocketFlags, SocketType}; 3b8a62b91Sopenharmony_ciuse crate::{backend, io}; 4b8a62b91Sopenharmony_ci 5b8a62b91Sopenharmony_ci/// `socketpair(domain, type_ | accept_flags, protocol)` 6b8a62b91Sopenharmony_ci/// 7b8a62b91Sopenharmony_ci/// # References 8b8a62b91Sopenharmony_ci/// - [POSIX] 9b8a62b91Sopenharmony_ci/// - [Linux] 10b8a62b91Sopenharmony_ci/// 11b8a62b91Sopenharmony_ci/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/socketpair.html 12b8a62b91Sopenharmony_ci/// [Linux]: https://man7.org/linux/man-pages/man2/socketpair.2.html 13b8a62b91Sopenharmony_ci#[inline] 14b8a62b91Sopenharmony_cipub fn socketpair( 15b8a62b91Sopenharmony_ci domain: AddressFamily, 16b8a62b91Sopenharmony_ci type_: SocketType, 17b8a62b91Sopenharmony_ci flags: SocketFlags, 18b8a62b91Sopenharmony_ci protocol: Protocol, 19b8a62b91Sopenharmony_ci) -> io::Result<(OwnedFd, OwnedFd)> { 20b8a62b91Sopenharmony_ci backend::net::syscalls::socketpair(domain, type_, flags, protocol) 21b8a62b91Sopenharmony_ci} 22