@@ -7,7 +7,6 @@ use cfg_if::cfg_if;
7
7
use libc:: { self , c_int, c_void, socklen_t} ;
8
8
use std:: ffi:: { OsStr , OsString } ;
9
9
use std:: mem:: { self , MaybeUninit } ;
10
- #[ cfg( target_family = "unix" ) ]
11
10
use std:: os:: unix:: ffi:: OsStrExt ;
12
11
use std:: os:: unix:: io:: { AsFd , AsRawFd } ;
13
12
@@ -329,9 +328,7 @@ cfg_if! {
329
328
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
330
329
/// Leave an IPv6 multicast group.
331
330
Ipv6DropMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_DROP_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
332
- } else if #[ cfg( any( bsd,
333
- target_os = "illumos" ,
334
- target_os = "solaris" ) ) ] {
331
+ } else if #[ cfg( any( bsd, solarish) ) ] {
335
332
#[ cfg( feature = "net" ) ]
336
333
sockopt_impl!(
337
334
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
@@ -403,7 +400,7 @@ sockopt_impl!(
403
400
libc:: IPV6_TCLASS ,
404
401
libc:: c_int
405
402
) ;
406
- #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux ") ) ]
403
+ #[ cfg( any( linux_android , target_os = "fuchsia" ) ) ]
407
404
#[ cfg( feature = "net" ) ]
408
405
sockopt_impl ! (
409
406
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
@@ -512,12 +509,7 @@ sockopt_impl!(
512
509
libc:: TCP_KEEPALIVE ,
513
510
u32
514
511
) ;
515
- #[ cfg( any(
516
- target_os = "android" ,
517
- target_os = "dragonfly" ,
518
- target_os = "freebsd" ,
519
- target_os = "linux"
520
- ) ) ]
512
+ #[ cfg( any( freebsdlike, linux_android) ) ]
521
513
#[ cfg( feature = "net" ) ]
522
514
sockopt_impl ! (
523
515
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
@@ -556,7 +548,7 @@ sockopt_impl!(
556
548
libc:: TCP_KEEPCNT ,
557
549
u32
558
550
) ;
559
- #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux ") ) ]
551
+ #[ cfg( any( linux_android , target_os = "fuchsia" ) ) ]
560
552
sockopt_impl ! (
561
553
#[ allow( missing_docs) ]
562
554
// Not documented by Linux!
@@ -826,12 +818,7 @@ sockopt_impl!(
826
818
libc:: TCP_CONGESTION ,
827
819
OsString <[ u8 ; TCP_CA_NAME_MAX ] >
828
820
) ;
829
- #[ cfg( any(
830
- target_os = "android" ,
831
- apple_targets,
832
- target_os = "linux" ,
833
- target_os = "netbsd" ,
834
- ) ) ]
821
+ #[ cfg( any( linux_android, apple_targets, target_os = "netbsd" ) ) ]
835
822
#[ cfg( feature = "net" ) ]
836
823
sockopt_impl ! (
837
824
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
@@ -844,10 +831,9 @@ sockopt_impl!(
844
831
bool
845
832
) ;
846
833
#[ cfg( any(
847
- target_os = "android" ,
834
+ linux_android ,
848
835
target_os = "freebsd" ,
849
836
apple_targets,
850
- target_os = "linux" ,
851
837
target_os = "netbsd" ,
852
838
target_os = "openbsd" ,
853
839
) ) ]
@@ -896,7 +882,7 @@ sockopt_impl!(
896
882
libc:: IP_RECVDSTADDR ,
897
883
bool
898
884
) ;
899
- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux ") ) ]
885
+ #[ cfg( any( linux_android , target_os = "freebsd" ) ) ]
900
886
#[ cfg( feature = "net" ) ]
901
887
sockopt_impl ! (
902
888
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
@@ -942,7 +928,7 @@ sockopt_impl!(
942
928
libc:: SO_TXTIME ,
943
929
libc:: sock_txtime
944
930
) ;
945
- #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux ") ) ]
931
+ #[ cfg( any( linux_android , target_os = "fuchsia" ) ) ]
946
932
sockopt_impl ! (
947
933
/// Indicates that an unsigned 32-bit value ancillary message (cmsg) should
948
934
/// be attached to received skbs indicating the number of packets dropped by
@@ -990,7 +976,7 @@ sockopt_impl!(
990
976
libc:: IP_MTU ,
991
977
libc:: c_int
992
978
) ;
993
- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux ") ) ]
979
+ #[ cfg( any( linux_android , target_os = "freebsd" ) ) ]
994
980
sockopt_impl ! (
995
981
/// Set or retrieve the current time-to-live field that is used in every
996
982
/// packet sent from this socket.
@@ -1000,7 +986,7 @@ sockopt_impl!(
1000
986
libc:: IP_TTL ,
1001
987
libc:: c_int
1002
988
) ;
1003
- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux ") ) ]
989
+ #[ cfg( any( linux_android , target_os = "freebsd" ) ) ]
1004
990
sockopt_impl ! (
1005
991
/// Set the unicast hop limit for the socket.
1006
992
Ipv6Ttl ,
@@ -1009,7 +995,7 @@ sockopt_impl!(
1009
995
libc:: IPV6_UNICAST_HOPS ,
1010
996
libc:: c_int
1011
997
) ;
1012
- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux ") ) ]
998
+ #[ cfg( any( linux_android , target_os = "freebsd" ) ) ]
1013
999
#[ cfg( feature = "net" ) ]
1014
1000
sockopt_impl ! (
1015
1001
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
@@ -1030,7 +1016,7 @@ sockopt_impl!(
1030
1016
libc:: IP_DONTFRAG ,
1031
1017
bool
1032
1018
) ;
1033
- #[ cfg( any( target_os = "android" , apple_targets, target_os = "linux" , ) ) ]
1019
+ #[ cfg( any( linux_android , apple_targets) ) ]
1034
1020
sockopt_impl ! (
1035
1021
/// Set "don't fragment packet" flag on the IPv6 packet.
1036
1022
Ipv6DontFrag ,
0 commit comments