mirror of
https://github.com/openharmony/third_party_rust_rustix.git
synced 2026-07-21 02:05:28 -04:00
325d679ee4
Remove rustix::io::OwnedFd, and just use the std and io_lifetimes' OwnedFd definition. Now that rustix is using io_lifetimes 1.0, which has switched to using the `OwnedFd` in std, this is no longer needed. This simplifies rustix' API, as users no longer have to be aware of the difference between rustix::io::OwnedFd and rustix::fd::OwnedFd.
23 lines
635 B
Rust
23 lines
635 B
Rust
use crate::backend;
|
|
use crate::fd::OwnedFd;
|
|
use crate::io;
|
|
use crate::net::{AddressFamily, Protocol, SocketFlags, SocketType};
|
|
|
|
/// `socketpair(domain, type_ | accept_flags, protocol)`
|
|
///
|
|
/// # References
|
|
/// - [POSIX]
|
|
/// - [Linux]
|
|
///
|
|
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/socketpair.html
|
|
/// [Linux]: https://man7.org/linux/man-pages/man2/socketpair.2.html
|
|
#[inline]
|
|
pub fn socketpair(
|
|
domain: AddressFamily,
|
|
type_: SocketType,
|
|
flags: SocketFlags,
|
|
protocol: Protocol,
|
|
) -> io::Result<(OwnedFd, OwnedFd)> {
|
|
backend::net::syscalls::socketpair(domain, type_, flags, protocol)
|
|
}
|