@@ -618,12 +618,7 @@ mod recvfrom {
618
618
assert_eq ! ( AddressFamily :: Inet , from. unwrap( ) . family( ) . unwrap( ) ) ;
619
619
}
620
620
621
- #[ cfg( any(
622
- target_os = "linux" ,
623
- target_os = "android" ,
624
- target_os = "freebsd" ,
625
- target_os = "netbsd" ,
626
- ) ) ]
621
+ #[ cfg( any( linux_android, target_os = "freebsd" , target_os = "netbsd" ) ) ]
627
622
#[ test]
628
623
pub fn udp_recvmmsg ( ) {
629
624
use nix:: sys:: socket:: { recvmmsg, MsgFlags } ;
@@ -699,12 +694,7 @@ mod recvfrom {
699
694
send_thread. join ( ) . unwrap ( ) ;
700
695
}
701
696
702
- #[ cfg( any(
703
- target_os = "linux" ,
704
- target_os = "android" ,
705
- target_os = "freebsd" ,
706
- target_os = "netbsd" ,
707
- ) ) ]
697
+ #[ cfg( any( linux_android, target_os = "freebsd" , target_os = "netbsd" ) ) ]
708
698
#[ test]
709
699
pub fn udp_recvmmsg_dontwait_short_read ( ) {
710
700
use nix:: sys:: socket:: { recvmmsg, MsgFlags } ;
@@ -1270,12 +1260,7 @@ pub fn test_sendmsg_ipv6packetinfo() {
1270
1260
//
1271
1261
// Note that binding to 0.0.0.0 is *required* on FreeBSD; sendmsg
1272
1262
// returns EINVAL otherwise. (See FreeBSD's ip(4) man page.)
1273
- #[ cfg( any(
1274
- target_os = "netbsd" ,
1275
- target_os = "freebsd" ,
1276
- target_os = "openbsd" ,
1277
- target_os = "dragonfly" ,
1278
- ) ) ]
1263
+ #[ cfg( any( freebsdlike, netbsdlike) ) ]
1279
1264
#[ test]
1280
1265
pub fn test_sendmsg_ipv4sendsrcaddr ( ) {
1281
1266
use nix:: sys:: socket:: {
@@ -1424,12 +1409,7 @@ pub fn test_sendmsg_empty_cmsgs() {
1424
1409
}
1425
1410
}
1426
1411
1427
- #[ cfg( any(
1428
- target_os = "android" ,
1429
- target_os = "linux" ,
1430
- target_os = "freebsd" ,
1431
- target_os = "dragonfly" ,
1432
- ) ) ]
1412
+ #[ cfg( any( linux_android, freebsdlike) ) ]
1433
1413
#[ test]
1434
1414
fn test_scm_credentials ( ) {
1435
1415
use nix:: sys:: socket:: {
@@ -1772,12 +1752,7 @@ fn loopback_address(
1772
1752
} )
1773
1753
}
1774
1754
1775
- #[ cfg( any(
1776
- target_os = "android" ,
1777
- apple_targets,
1778
- target_os = "linux" ,
1779
- target_os = "netbsd" ,
1780
- ) ) ]
1755
+ #[ cfg( any( linux_android, apple_targets, target_os = "netbsd" ) ) ]
1781
1756
// qemu doesn't seem to be emulating this correctly in these architectures
1782
1757
#[ cfg_attr(
1783
1758
all(
@@ -1982,7 +1957,7 @@ pub fn test_recvif() {
1982
1957
}
1983
1958
}
1984
1959
1985
- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux ") ) ]
1960
+ #[ cfg( any( linux_android , target_os = "freebsd" ) ) ]
1986
1961
#[ cfg_attr( qemu, ignore) ]
1987
1962
#[ test]
1988
1963
pub fn test_recvif_ipv4 ( ) {
@@ -2068,7 +2043,7 @@ pub fn test_recvif_ipv4() {
2068
2043
}
2069
2044
}
2070
2045
2071
- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux ") ) ]
2046
+ #[ cfg( any( linux_android , target_os = "freebsd" ) ) ]
2072
2047
#[ cfg_attr( qemu, ignore) ]
2073
2048
#[ test]
2074
2049
pub fn test_recvif_ipv6 ( ) {
@@ -2154,14 +2129,7 @@ pub fn test_recvif_ipv6() {
2154
2129
}
2155
2130
}
2156
2131
2157
- #[ cfg( any(
2158
- target_os = "android" ,
2159
- target_os = "freebsd" ,
2160
- apple_targets,
2161
- target_os = "linux" ,
2162
- target_os = "netbsd" ,
2163
- target_os = "openbsd" ,
2164
- ) ) ]
2132
+ #[ cfg( any( linux_android, target_os = "freebsd" , apple_targets, netbsdlike) ) ]
2165
2133
// qemu doesn't seem to be emulating this correctly in these architectures
2166
2134
#[ cfg_attr(
2167
2135
all(
@@ -2458,7 +2426,7 @@ fn test_recvmmsg_timestampns() {
2458
2426
// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack
2459
2427
// of QEMU support is suspected.
2460
2428
#[ cfg_attr( qemu, ignore) ]
2461
- #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux ") ) ]
2429
+ #[ cfg( any( linux_android , target_os = "fuchsia" ) ) ]
2462
2430
#[ test]
2463
2431
fn test_recvmsg_rxq_ovfl ( ) {
2464
2432
use nix:: sys:: socket:: sockopt:: { RcvBuf , RxqOvfl } ;
@@ -2552,7 +2520,7 @@ fn test_recvmsg_rxq_ovfl() {
2552
2520
assert_eq ! ( drop_counter, 1 ) ;
2553
2521
}
2554
2522
2555
- #[ cfg( any ( target_os = "linux" , target_os = "android" , ) ) ]
2523
+ #[ cfg( linux_android ) ]
2556
2524
mod linux_errqueue {
2557
2525
use super :: FromStr ;
2558
2526
use nix:: sys:: socket:: * ;
0 commit comments