Skip to content

Commit

Permalink
uds: add NetBSD support (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
iquiw authored and tobz committed Oct 24, 2018
1 parent 7f84f6b commit 2291ba9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tokio-uds/src/ucred.rs
Expand Up @@ -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"))]
Expand Down Expand Up @@ -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};
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 2291ba9

Please sign in to comment.