Skip to content
Permalink
Browse files

uds: add NetBSD support (#715)

  • Loading branch information...
iquiw authored and tobz committed Oct 24, 2018
1 parent 7f84f6b commit 2291ba9d0db89de7d0534566e8dce2892c2fbd23
Showing with 3 additions and 2 deletions.
  1. +3 −2 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();

0 comments on commit 2291ba9

Please sign in to comment.
You can’t perform that action at this time.