Files
third_party_rust_rustix/src/net/socketpair.rs
T
Dan Gohman 325d679ee4 Remove rustix::io::OwnedFd.
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.
2022-08-20 08:30:47 -07:00

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)
}