From 2291ba9d0db89de7d0534566e8dce2892c2fbd23 Mon Sep 17 00:00:00 2001 From: Iku Iwasa Date: Wed, 24 Oct 2018 09:15:42 +0900 Subject: [PATCH] uds: add NetBSD support (#715) --- tokio-uds/src/ucred.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tokio-uds/src/ucred.rs b/tokio-uds/src/ucred.rs index cf792f912..36a706be9 100644 --- a/tokio-uds/src/ucred.rs +++ b/tokio-uds/src/ucred.rs @@ -12,7 +12,7 @@ pub struct UCred { #[cfg(any(target_os = "linux", target_os = "android"))] 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; #[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 { use libc::getpeereid; use std::{io, mem}; @@ -95,6 +95,7 @@ mod 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 = "netbsd", ignore = "NetBSD does not support getpeereid() for sockets created by socketpair()")] fn test_socket_pair() { let (a, b) = UnixStream::pair().unwrap(); let cred_a = a.peer_cred().unwrap();