diff options
author | Jonas Schievink <jonasschievink@gmail.com> | 2018-07-04 14:52:51 +0200 |
---|---|---|
committer | Jonas Schievink <jonasschievink@gmail.com> | 2018-07-05 16:40:06 +0200 |
commit | 594b924fb5a4c567828ce4a0e2f0fa678bd3b7fc (patch) | |
tree | f7623c723355a7fd22217ae0d5ad069281d91843 /src/sys/socket | |
parent | e0577cc89059267e996027f45578f09f34b7347b (diff) | |
download | nix-594b924fb5a4c567828ce4a0e2f0fa678bd3b7fc.zip |
Get `SO_PEERCRED` working on all Linux targets
Diffstat (limited to 'src/sys/socket')
-rw-r--r-- | src/sys/socket/mod.rs | 2 | ||||
-rw-r--r-- | src/sys/socket/sockopt.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index b46fa8b0..20de6af4 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -173,7 +173,7 @@ libc_bitflags!{ } cfg_if! { - if #[cfg(all(target_os = "linux", not(target_arch = "arm")))] { + if #[cfg(any(target_os = "android", target_os = "linux"))] { /// Unix credentials of the sending process. /// /// This struct is used with the `SO_PEERCRED` ancillary message for UNIX sockets. diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index cc156272..56f3a1ee 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -225,7 +225,7 @@ sockopt_impl!(Both, Broadcast, libc::SOL_SOCKET, libc::SO_BROADCAST, bool); sockopt_impl!(Both, OobInline, libc::SOL_SOCKET, libc::SO_OOBINLINE, bool); sockopt_impl!(GetOnly, SocketError, libc::SOL_SOCKET, libc::SO_ERROR, i32); sockopt_impl!(Both, KeepAlive, libc::SOL_SOCKET, libc::SO_KEEPALIVE, bool); -#[cfg(all(target_os = "linux", not(target_arch="arm")))] +#[cfg(any(target_os = "android", target_os = "linux"))] sockopt_impl!(GetOnly, PeerCredentials, libc::SOL_SOCKET, libc::SO_PEERCRED, super::UnixCredentials); #[cfg(any(target_os = "ios", target_os = "macos"))] @@ -478,7 +478,7 @@ unsafe impl<'a> Set<'a, usize> for SetUsize { #[cfg(test)] mod test { - #[cfg(all(target_os = "linux", not(target_arch = "arm")))] + #[cfg(any(target_os = "android", target_os = "linux"))] #[test] fn can_get_peercred_on_unix_socket() { use super::super::*; |