@@ -556,12 +556,7 @@ mod recvfrom {
556556 }
557557 }
558558
559- #[ cfg( any(
560- target_os = "linux" ,
561- target_os = "android" ,
562- target_os = "freebsd" ,
563- target_os = "netbsd" ,
564- ) ) ]
559+ #[ cfg( any( linux_android, target_os = "freebsd" , target_os = "netbsd" ) ) ]
565560 #[ test]
566561 pub fn udp_sendmmsg ( ) {
567562 use std:: io:: IoSlice ;
@@ -623,12 +618,7 @@ mod recvfrom {
623618 assert_eq ! ( AddressFamily :: Inet , from. unwrap( ) . family( ) . unwrap( ) ) ;
624619 }
625620
626- #[ cfg( any(
627- target_os = "linux" ,
628- target_os = "android" ,
629- target_os = "freebsd" ,
630- target_os = "netbsd" ,
631- ) ) ]
621+ #[ cfg( any( linux_android, target_os = "freebsd" , target_os = "netbsd" ) ) ]
632622 #[ test]
633623 pub fn udp_recvmmsg ( ) {
634624 use nix:: sys:: socket:: { recvmmsg, MsgFlags } ;
@@ -704,12 +694,7 @@ mod recvfrom {
704694 send_thread. join ( ) . unwrap ( ) ;
705695 }
706696
707- #[ cfg( any(
708- target_os = "linux" ,
709- target_os = "android" ,
710- target_os = "freebsd" ,
711- target_os = "netbsd" ,
712- ) ) ]
697+ #[ cfg( any( linux_android, target_os = "freebsd" , target_os = "netbsd" ) ) ]
713698 #[ test]
714699 pub fn udp_recvmmsg_dontwait_short_read ( ) {
715700 use nix:: sys:: socket:: { recvmmsg, MsgFlags } ;
@@ -1275,12 +1260,7 @@ pub fn test_sendmsg_ipv6packetinfo() {
12751260//
12761261// Note that binding to 0.0.0.0 is *required* on FreeBSD; sendmsg
12771262// returns EINVAL otherwise. (See FreeBSD's ip(4) man page.)
1278- #[ cfg( any(
1279- target_os = "netbsd" ,
1280- target_os = "freebsd" ,
1281- target_os = "openbsd" ,
1282- target_os = "dragonfly" ,
1283- ) ) ]
1263+ #[ cfg( any( freebsdlike, netbsdlike) ) ]
12841264#[ test]
12851265pub fn test_sendmsg_ipv4sendsrcaddr ( ) {
12861266 use nix:: sys:: socket:: {
@@ -1429,12 +1409,7 @@ pub fn test_sendmsg_empty_cmsgs() {
14291409 }
14301410}
14311411
1432- #[ cfg( any(
1433- target_os = "android" ,
1434- target_os = "linux" ,
1435- target_os = "freebsd" ,
1436- target_os = "dragonfly" ,
1437- ) ) ]
1412+ #[ cfg( any( linux_android, freebsdlike) ) ]
14381413#[ test]
14391414fn test_scm_credentials ( ) {
14401415 use nix:: sys:: socket:: {
@@ -1777,12 +1752,7 @@ fn loopback_address(
17771752 } )
17781753}
17791754
1780- #[ cfg( any(
1781- target_os = "android" ,
1782- apple_targets,
1783- target_os = "linux" ,
1784- target_os = "netbsd" ,
1785- ) ) ]
1755+ #[ cfg( any( linux_android, apple_targets, target_os = "netbsd" ) ) ]
17861756// qemu doesn't seem to be emulating this correctly in these architectures
17871757#[ cfg_attr(
17881758 all(
@@ -1987,7 +1957,7 @@ pub fn test_recvif() {
19871957 }
19881958}
19891959
1990- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux ") ) ]
1960+ #[ cfg( any( linux_android , target_os = "freebsd" ) ) ]
19911961#[ cfg_attr( qemu, ignore) ]
19921962#[ test]
19931963pub fn test_recvif_ipv4 ( ) {
@@ -2073,7 +2043,7 @@ pub fn test_recvif_ipv4() {
20732043 }
20742044}
20752045
2076- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux ") ) ]
2046+ #[ cfg( any( linux_android , target_os = "freebsd" ) ) ]
20772047#[ cfg_attr( qemu, ignore) ]
20782048#[ test]
20792049pub fn test_recvif_ipv6 ( ) {
@@ -2159,14 +2129,7 @@ pub fn test_recvif_ipv6() {
21592129 }
21602130}
21612131
2162- #[ cfg( any(
2163- target_os = "android" ,
2164- target_os = "freebsd" ,
2165- apple_targets,
2166- target_os = "linux" ,
2167- target_os = "netbsd" ,
2168- target_os = "openbsd" ,
2169- ) ) ]
2132+ #[ cfg( any( linux_android, target_os = "freebsd" , apple_targets, netbsdlike) ) ]
21702133// qemu doesn't seem to be emulating this correctly in these architectures
21712134#[ cfg_attr(
21722135 all(
@@ -2463,7 +2426,7 @@ fn test_recvmmsg_timestampns() {
24632426// Disable the test on emulated platforms because it fails in Cirrus-CI. Lack
24642427// of QEMU support is suspected.
24652428#[ cfg_attr( qemu, ignore) ]
2466- #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux ") ) ]
2429+ #[ cfg( any( linux_android , target_os = "fuchsia" ) ) ]
24672430#[ test]
24682431fn test_recvmsg_rxq_ovfl ( ) {
24692432 use nix:: sys:: socket:: sockopt:: { RcvBuf , RxqOvfl } ;
@@ -2557,7 +2520,7 @@ fn test_recvmsg_rxq_ovfl() {
25572520 assert_eq ! ( drop_counter, 1 ) ;
25582521}
25592522
2560- #[ cfg( any ( target_os = "linux" , target_os = "android" , ) ) ]
2523+ #[ cfg( linux_android ) ]
25612524mod linux_errqueue {
25622525 use super :: FromStr ;
25632526 use nix:: sys:: socket:: * ;
0 commit comments