File tree 2 files changed +18
-0
lines changed
library/std/src/sys/unix/ext
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,15 @@ impl UnixStream {
443
443
/// }
444
444
/// ```
445
445
#[ 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
+ ) ) ]
446
455
pub fn peer_cred ( & self ) -> io:: Result < UCred > {
447
456
ucred:: peer_cred ( self )
448
457
}
Original file line number Diff line number Diff line change @@ -2,6 +2,15 @@ use crate::os::unix::net::UnixStream;
2
2
use libc:: { getegid, geteuid} ;
3
3
4
4
#[ 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
+ ) ) ]
5
14
fn test_socket_pair ( ) {
6
15
// Create two connected sockets and get their peer credentials. They should be equal.
7
16
let ( sock_a, sock_b) = UnixStream :: pair ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments