pub fn peer_uid<F: AsFd>(sock: &F) -> Result<u32>
Peer uid from SO_PEERCRED on Linux, or getpeereid on BSD/macOS.
SO_PEERCRED
getpeereid
Returns an error when the socket option cannot be read, or this OS cannot report peer credentials.