@@ -255,16 +255,14 @@ libc_bitflags! {
255
255
/// Set non-blocking mode on the new socket
256
256
#[ cfg( any( linux_android,
257
257
freebsdlike,
258
- target_os = "illumos" ,
259
- target_os = "netbsd" ,
260
- target_os = "openbsd" ) ) ]
258
+ netbsdlike,
259
+ target_os = "illumos" ) ) ]
261
260
SOCK_NONBLOCK ;
262
261
/// Set close-on-exec on the new descriptor
263
262
#[ cfg( any( linux_android,
264
263
freebsdlike,
265
- target_os = "illumos" ,
266
- target_os = "netbsd" ,
267
- target_os = "openbsd" ) ) ]
264
+ netbsdlike,
265
+ target_os = "illumos" ) ) ]
268
266
SOCK_CLOEXEC ;
269
267
/// Return `EPIPE` instead of raising `SIGPIPE`
270
268
#[ cfg( target_os = "netbsd" ) ]
@@ -329,28 +327,23 @@ libc_bitflags! {
329
327
/// [open(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html).
330
328
///
331
329
/// Only used in [`recvmsg`](fn.recvmsg.html) function.
332
- #[ cfg( any( linux_android,
333
- freebsdlike,
334
- target_os = "netbsd" ,
335
- target_os = "openbsd" ) ) ]
330
+ #[ cfg( any( linux_android, freebsdlike, netbsdlike) ) ]
336
331
MSG_CMSG_CLOEXEC ;
337
332
/// Requests not to send `SIGPIPE` errors when the other end breaks the connection.
338
333
/// (For more details, see [send(2)](https://linux.die.net/man/2/send)).
339
334
#[ cfg( any( linux_android,
340
335
freebsdlike,
341
336
solarish,
337
+ netbsdlike,
342
338
target_os = "fuchsia" ,
343
- target_os = "haiku" ,
344
- target_os = "netbsd" ,
345
- target_os = "openbsd" ) ) ]
339
+ target_os = "haiku" ) ) ]
346
340
MSG_NOSIGNAL ;
347
341
/// Turns on [`MSG_DONTWAIT`] after the first message has been received (only for
348
342
/// `recvmmsg()`).
349
343
#[ cfg( any( linux_android,
344
+ netbsdlike,
350
345
target_os = "fuchsia" ,
351
- target_os = "netbsd" ,
352
346
target_os = "freebsd" ,
353
- target_os = "openbsd" ,
354
347
target_os = "solaris" ) ) ]
355
348
MSG_WAITFORONE ;
356
349
}
@@ -755,21 +748,11 @@ pub enum ControlMessageOwned {
755
748
#[ cfg( feature = "net" ) ]
756
749
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
757
750
Ipv6PacketInfo ( libc:: in6_pktinfo) ,
758
- #[ cfg( any(
759
- target_os = "freebsd" ,
760
- apple_targets,
761
- target_os = "netbsd" ,
762
- target_os = "openbsd" ,
763
- ) ) ]
751
+ #[ cfg( any( target_os = "freebsd" , apple_targets, netbsdlike) ) ]
764
752
#[ cfg( feature = "net" ) ]
765
753
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
766
754
Ipv4RecvIf ( libc:: sockaddr_dl) ,
767
- #[ cfg( any(
768
- target_os = "freebsd" ,
769
- apple_targets,
770
- target_os = "netbsd" ,
771
- target_os = "openbsd" ,
772
- ) ) ]
755
+ #[ cfg( any( target_os = "freebsd" , apple_targets, netbsdlike) ) ]
773
756
#[ cfg( feature = "net" ) ]
774
757
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
775
758
Ipv4RecvDstAddr ( libc:: in_addr) ,
@@ -948,23 +931,13 @@ impl ControlMessageOwned {
948
931
let info = unsafe { ptr:: read_unaligned( p as * const libc:: in_pktinfo) } ;
949
932
ControlMessageOwned :: Ipv4PacketInfo ( info)
950
933
}
951
- #[ cfg( any(
952
- target_os = "freebsd" ,
953
- apple_targets,
954
- target_os = "netbsd" ,
955
- target_os = "openbsd" ,
956
- ) ) ]
934
+ #[ cfg( any( target_os = "freebsd" , apple_targets, netbsdlike) ) ]
957
935
#[ cfg( feature = "net" ) ]
958
936
( libc:: IPPROTO_IP , libc:: IP_RECVIF ) => {
959
937
let dl = unsafe { ptr:: read_unaligned( p as * const libc:: sockaddr_dl) } ;
960
938
ControlMessageOwned :: Ipv4RecvIf ( dl)
961
939
} ,
962
- #[ cfg( any(
963
- target_os = "freebsd" ,
964
- apple_targets,
965
- target_os = "netbsd" ,
966
- target_os = "openbsd" ,
967
- ) ) ]
940
+ #[ cfg( any( target_os = "freebsd" , apple_targets, netbsdlike) ) ]
968
941
#[ cfg( feature = "net" ) ]
969
942
( libc:: IPPROTO_IP , libc:: IP_RECVDSTADDR ) => {
970
943
let dl = unsafe { ptr:: read_unaligned( p as * const libc:: in_addr) } ;
@@ -1124,10 +1097,7 @@ pub enum ControlMessage<'a> {
1124
1097
///
1125
1098
/// For further information, please refer to the
1126
1099
/// [`ip(7)`](https://man7.org/linux/man-pages/man7/ip.7.html) man page.
1127
- #[ cfg( any( target_os = "linux" ,
1128
- target_os = "netbsd" ,
1129
- target_os = "android" ,
1130
- apple_targets) ) ]
1100
+ #[ cfg( any( linux_android, target_os = "netbsd" , apple_targets) ) ]
1131
1101
#[ cfg( feature = "net" ) ]
1132
1102
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
1133
1103
Ipv4PacketInfo ( & ' a libc:: in_pktinfo) ,
@@ -1145,7 +1115,7 @@ pub enum ControlMessage<'a> {
1145
1115
Ipv6PacketInfo ( & ' a libc:: in6_pktinfo) ,
1146
1116
1147
1117
/// Configure the IPv4 source address with `IP_SENDSRCADDR`.
1148
- #[ cfg( any( freebsdlike, target_os = "netbsd" , target_os = "openbsd" ) ) ]
1118
+ #[ cfg( any( freebsdlike, netbsdlike ) ) ]
1149
1119
#[ cfg( feature = "net" ) ]
1150
1120
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
1151
1121
Ipv4SendSrcAddr ( & ' a libc:: in_addr) ,
@@ -1268,7 +1238,7 @@ impl<'a> ControlMessage<'a> {
1268
1238
target_os = "freebsd" , apple_targets) ) ]
1269
1239
#[ cfg( feature = "net" ) ]
1270
1240
ControlMessage :: Ipv6PacketInfo ( info) => info as * const _ as * const u8 ,
1271
- #[ cfg( any( freebsdlike, target_os = "netbsd" , target_os = "openbsd" ) ) ]
1241
+ #[ cfg( any( freebsdlike, netbsdlike ) ) ]
1272
1242
#[ cfg( feature = "net" ) ]
1273
1243
ControlMessage :: Ipv4SendSrcAddr ( addr) => addr as * const _ as * const u8 ,
1274
1244
#[ cfg( any( linux_android, freebsdlike, apple_targets, target_os = "haiku" ) ) ]
@@ -1330,7 +1300,7 @@ impl<'a> ControlMessage<'a> {
1330
1300
target_os = "freebsd" , apple_targets) ) ]
1331
1301
#[ cfg( feature = "net" ) ]
1332
1302
ControlMessage :: Ipv6PacketInfo ( info) => mem:: size_of_val( info) ,
1333
- #[ cfg( any( freebsdlike, target_os = "netbsd" , target_os = "openbsd" ) ) ]
1303
+ #[ cfg( any( freebsdlike, netbsdlike ) ) ]
1334
1304
#[ cfg( feature = "net" ) ]
1335
1305
ControlMessage :: Ipv4SendSrcAddr ( addr) => mem:: size_of_val( addr) ,
1336
1306
#[ cfg( any( linux_android, freebsdlike, apple_targets, target_os = "haiku" ) ) ]
@@ -1370,7 +1340,7 @@ impl<'a> ControlMessage<'a> {
1370
1340
target_os = "freebsd" , apple_targets) ) ]
1371
1341
#[ cfg( feature = "net" ) ]
1372
1342
ControlMessage :: Ipv6PacketInfo ( _) => libc:: IPPROTO_IPV6 ,
1373
- #[ cfg( any( freebsdlike, target_os = "netbsd" , target_os = "openbsd" ) ) ]
1343
+ #[ cfg( any( freebsdlike, netbsdlike ) ) ]
1374
1344
#[ cfg( feature = "net" ) ]
1375
1345
ControlMessage :: Ipv4SendSrcAddr ( _) => libc:: IPPROTO_IP ,
1376
1346
#[ cfg( any( linux_android, freebsdlike, apple_targets, target_os = "haiku" ) ) ]
@@ -1415,7 +1385,7 @@ impl<'a> ControlMessage<'a> {
1415
1385
target_os = "freebsd" , apple_targets) ) ]
1416
1386
#[ cfg( feature = "net" ) ]
1417
1387
ControlMessage :: Ipv6PacketInfo ( _) => libc:: IPV6_PKTINFO ,
1418
- #[ cfg( any( freebsdlike, target_os = "netbsd" , target_os = "openbsd" ) ) ]
1388
+ #[ cfg( any( freebsdlike, netbsdlike ) ) ]
1419
1389
#[ cfg( feature = "net" ) ]
1420
1390
ControlMessage :: Ipv4SendSrcAddr ( _) => libc:: IP_SENDSRCADDR ,
1421
1391
#[ cfg( any( linux_android, freebsdlike, apple_targets, target_os = "haiku" ) ) ]
@@ -2183,12 +2153,11 @@ pub fn accept(sockfd: RawFd) -> Result<RawFd> {
2183
2153
)
2184
2154
) ,
2185
2155
freebsdlike,
2156
+ netbsdlike,
2186
2157
target_os = "emscripten" ,
2187
2158
target_os = "fuchsia" ,
2188
2159
target_os = "illumos" ,
2189
2160
target_os = "linux" ,
2190
- target_os = "netbsd" ,
2191
- target_os = "openbsd"
2192
2161
) ) ]
2193
2162
pub fn accept4 ( sockfd : RawFd , flags : SockFlag ) -> Result < RawFd > {
2194
2163
let res = unsafe {
0 commit comments