mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
uds: add NetBSD support (#715)
This commit is contained in:
parent
7f84f6b4ca
commit
2291ba9d0d
@ -12,7 +12,7 @@ pub struct UCred {
|
|||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
pub use self::impl_linux::get_peer_cred;
|
pub use self::impl_linux::get_peer_cred;
|
||||||
|
|
||||||
#[cfg(any(target_os = "dragonfly", target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "openbsd"))]
|
#[cfg(any(target_os = "dragonfly", target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))]
|
||||||
pub use self::impl_macos::get_peer_cred;
|
pub use self::impl_macos::get_peer_cred;
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||||
@ -61,7 +61,7 @@ pub mod impl_linux {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "dragonfly", target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "openbsd"))]
|
#[cfg(any(target_os = "dragonfly", target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))]
|
||||||
pub mod impl_macos {
|
pub mod impl_macos {
|
||||||
use libc::getpeereid;
|
use libc::getpeereid;
|
||||||
use std::{io, mem};
|
use std::{io, mem};
|
||||||
@ -95,6 +95,7 @@ mod test {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_os = "freebsd", ignore = "Requires FreeBSD 12.0 or later. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=176419")]
|
#[cfg_attr(target_os = "freebsd", ignore = "Requires FreeBSD 12.0 or later. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=176419")]
|
||||||
|
#[cfg_attr(target_os = "netbsd", ignore = "NetBSD does not support getpeereid() for sockets created by socketpair()")]
|
||||||
fn test_socket_pair() {
|
fn test_socket_pair() {
|
||||||
let (a, b) = UnixStream::pair().unwrap();
|
let (a, b) = UnixStream::pair().unwrap();
|
||||||
let cred_a = a.peer_cred().unwrap();
|
let cred_a = a.peer_cred().unwrap();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user