File tree 2 files changed +17
-0
lines changed
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/).
13
13
([ #1912 ] ( https://github.com/nix-rust/nix/pull/1912 ) )
14
14
- Added ` mq_timedreceive ` to ` ::nix::mqueue ` .
15
15
([ #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 ) )
16
17
17
18
### Changed
18
19
Original file line number Diff line number Diff line change @@ -54,6 +54,22 @@ pub fn test_local_peercred_stream() {
54
54
assert_eq ! ( Gid :: from_raw( xucred. groups( ) [ 0 ] ) , Gid :: current( ) ) ;
55
55
}
56
56
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
+
57
73
#[ cfg( target_os = "linux" ) ]
58
74
#[ test]
59
75
fn is_so_mark_functional ( ) {
You can’t perform that action at this time.
0 commit comments