File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1313 ([ #1912 ] ( https://github.com/nix-rust/nix/pull/1912 ) )
1414- Added ` mq_timedreceive ` to ` ::nix::mqueue ` .
1515 ([ #1966 ] )(https://github.com/nix-rust/nix/pull/1966 )
16+ - Added ` LocalPeerPid ` to ` nix::sys::socket::sockopt ` for macOS. ([ #1967 ] ( https://github.com/nix-rust/nix/pull/1967 ) )
1617
1718### Changed
1819
Original file line number Diff line number Diff line change @@ -54,6 +54,22 @@ pub fn test_local_peercred_stream() {
5454 assert_eq ! ( Gid :: from_raw( xucred. groups( ) [ 0 ] ) , Gid :: current( ) ) ;
5555}
5656
57+ #[ cfg( target_os = "macos" ) ]
58+ #[ test]
59+ pub fn test_local_peer_pid ( ) {
60+ use nix:: sys:: socket:: socketpair;
61+
62+ let ( fd1, _fd2) = socketpair (
63+ AddressFamily :: Unix ,
64+ SockType :: Stream ,
65+ None ,
66+ SockFlag :: empty ( ) ,
67+ )
68+ . unwrap ( ) ;
69+ let pid = getsockopt ( fd1, sockopt:: LocalPeerPid ) . unwrap ( ) ;
70+ assert_eq ! ( pid, std:: process:: id( ) as _) ;
71+ }
72+
5773#[ cfg( target_os = "linux" ) ]
5874#[ test]
5975fn is_so_mark_functional ( ) {
You can’t perform that action at this time.
0 commit comments