From 61bd3e2a8f0cefaef4799fd6049f264244752de6 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Wed, 11 Jan 2023 13:13:44 +0100 Subject: Added LOCAL_PEERPID/LocalPeerPid sockopt for macos --- src/sys/socket/sockopt.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index dd24208f..cea623ae 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -492,6 +492,15 @@ sockopt_impl!( libc::LOCAL_PEERCRED, super::XuCred ); +#[cfg(any(target_os = "macos"))] +sockopt_impl!( + /// Get the PID of the peer process of a connected unix domain socket. + LocalPeerPid, + GetOnly, + 0, + libc::LOCAL_PEERPID, + libc::c_int +); #[cfg(any(target_os = "android", target_os = "linux"))] sockopt_impl!( /// Return the credentials of the foreign process connected to this socket. -- cgit v1.2.3