netbsd enabled ucred

This commit is contained in:
David Carlier 2021-07-24 16:02:35 +01:00
parent f9b95f92c8
commit 42adaab699
3 changed files with 16 additions and 2 deletions

View File

@ -82,6 +82,7 @@ pub mod thread;
target_os = "freebsd",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"
))]
pub mod ucred;

View File

@ -21,6 +21,7 @@ use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
target_os = "freebsd",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"
))]
use crate::os::unix::ucred;
@ -38,6 +39,7 @@ use crate::time::Duration;
target_os = "freebsd",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"
))]
pub use ucred::UCred;
@ -208,6 +210,7 @@ impl UnixStream {
target_os = "freebsd",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"
))]
pub fn peer_cred(&self) -> io::Result<UCred> {

View File

@ -28,7 +28,12 @@ pub struct UCred {
#[cfg(any(target_os = "android", target_os = "linux"))]
pub use self::impl_linux::peer_cred;
#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))]
#[cfg(any(
target_os = "dragonfly",
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd"
))]
pub use self::impl_bsd::peer_cred;
#[cfg(any(target_os = "macos", target_os = "ios",))]
@ -70,7 +75,12 @@ pub mod impl_linux {
}
}
#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))]
#[cfg(any(
target_os = "dragonfly",
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd"
))]
pub mod impl_bsd {
use super::UCred;
use crate::io;