File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
library/std/src/sys/unix/ext Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,15 @@ impl UnixStream {
443443 /// }
444444 /// ```
445445 #[ unstable( feature = "peer_credentials_unix_socket" , issue = "42839" , reason = "unstable" ) ]
446+ #[ cfg( any(
447+ target_os = "android" ,
448+ target_os = "linux" ,
449+ target_os = "dragonfly" ,
450+ target_os = "freebsd" ,
451+ target_os = "ios" ,
452+ target_os = "macos" ,
453+ target_os = "openbsd"
454+ ) ) ]
446455 pub fn peer_cred ( & self ) -> io:: Result < UCred > {
447456 ucred:: peer_cred ( self )
448457 }
Original file line number Diff line number Diff line change @@ -2,6 +2,15 @@ use crate::os::unix::net::UnixStream;
22use libc:: { getegid, geteuid} ;
33
44#[ test]
5+ #[ cfg( any(
6+ target_os = "android" ,
7+ target_os = "linux" ,
8+ target_os = "dragonfly" ,
9+ target_os = "freebsd" ,
10+ target_os = "ios" ,
11+ target_os = "macos" ,
12+ target_os = "openbsd"
13+ ) ) ]
514fn test_socket_pair ( ) {
615 // Create two connected sockets and get their peer credentials. They should be equal.
716 let ( sock_a, sock_b) = UnixStream :: pair ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments