@@ -76,6 +76,8 @@ pub(crate) use libc::{
76
76
#[ cfg( not( target_os = "redox" ) ) ]
77
77
pub ( crate ) use libc:: { MSG_TRUNC , SO_OOBINLINE } ;
78
78
// Used in `Socket`.
79
+ #[ cfg( not( target_os = "nto" ) ) ]
80
+ pub ( crate ) use libc:: ipv6_mreq as Ipv6Mreq ;
79
81
#[ cfg( not( any(
80
82
target_os = "dragonfly" ,
81
83
target_os = "fuchsia" ,
@@ -98,6 +100,7 @@ pub(crate) use libc::IP_HDRINCL;
98
100
target_os = "redox" ,
99
101
target_os = "solaris" ,
100
102
target_os = "haiku" ,
103
+ target_os = "nto" ,
101
104
) ) ) ]
102
105
pub ( crate ) use libc:: IP_RECVTOS ;
103
106
#[ cfg( not( any(
@@ -112,11 +115,11 @@ pub(crate) use libc::SO_LINGER;
112
115
#[ cfg( target_vendor = "apple" ) ]
113
116
pub ( crate ) use libc:: SO_LINGER_SEC as SO_LINGER ;
114
117
pub ( crate ) use libc:: {
115
- ip_mreq as IpMreq , ipv6_mreq as Ipv6Mreq , linger, IPPROTO_IP , IPPROTO_IPV6 ,
116
- IPV6_MULTICAST_HOPS , IPV6_MULTICAST_IF , IPV6_MULTICAST_LOOP , IPV6_UNICAST_HOPS , IPV6_V6ONLY ,
117
- IP_ADD_MEMBERSHIP , IP_DROP_MEMBERSHIP , IP_MULTICAST_IF , IP_MULTICAST_LOOP , IP_MULTICAST_TTL ,
118
- IP_TTL , MSG_OOB , MSG_PEEK , SOL_SOCKET , SO_BROADCAST , SO_ERROR , SO_KEEPALIVE , SO_RCVBUF ,
119
- SO_RCVTIMEO , SO_REUSEADDR , SO_SNDBUF , SO_SNDTIMEO , SO_TYPE , TCP_NODELAY ,
118
+ ip_mreq as IpMreq , linger, IPPROTO_IP , IPPROTO_IPV6 , IPV6_MULTICAST_HOPS , IPV6_MULTICAST_IF ,
119
+ IPV6_MULTICAST_LOOP , IPV6_UNICAST_HOPS , IPV6_V6ONLY , IP_ADD_MEMBERSHIP , IP_DROP_MEMBERSHIP ,
120
+ IP_MULTICAST_IF , IP_MULTICAST_LOOP , IP_MULTICAST_TTL , IP_TTL , MSG_OOB , MSG_PEEK , SOL_SOCKET ,
121
+ SO_BROADCAST , SO_ERROR , SO_KEEPALIVE , SO_RCVBUF , SO_RCVTIMEO , SO_REUSEADDR , SO_SNDBUF ,
122
+ SO_SNDTIMEO , SO_TYPE , TCP_NODELAY ,
120
123
} ;
121
124
#[ cfg( not( any(
122
125
target_os = "dragonfly" ,
@@ -125,6 +128,7 @@ pub(crate) use libc::{
125
128
target_os = "openbsd" ,
126
129
target_os = "redox" ,
127
130
target_os = "fuchsia" ,
131
+ target_os = "nto" ,
128
132
) ) ) ]
129
133
pub ( crate ) use libc:: {
130
134
ip_mreq_source as IpMreqSource , IP_ADD_SOURCE_MEMBERSHIP , IP_DROP_SOURCE_MEMBERSHIP ,
@@ -137,6 +141,7 @@ pub(crate) use libc::{
137
141
target_os = "netbsd" ,
138
142
target_os = "openbsd" ,
139
143
target_os = "solaris" ,
144
+ target_os = "nto" ,
140
145
target_vendor = "apple"
141
146
) ) ) ]
142
147
pub ( crate ) use libc:: { IPV6_ADD_MEMBERSHIP , IPV6_DROP_MEMBERSHIP } ;
@@ -173,7 +178,12 @@ pub(crate) type Bool = c_int;
173
178
174
179
#[ cfg( target_vendor = "apple" ) ]
175
180
use libc:: TCP_KEEPALIVE as KEEPALIVE_TIME ;
176
- #[ cfg( not( any( target_vendor = "apple" , target_os = "haiku" , target_os = "openbsd" ) ) ) ]
181
+ #[ cfg( not( any(
182
+ target_vendor = "apple" ,
183
+ target_os = "haiku" ,
184
+ target_os = "openbsd" ,
185
+ target_os = "nto" ,
186
+ ) ) ) ]
177
187
use libc:: TCP_KEEPIDLE as KEEPALIVE_TIME ;
178
188
179
189
/// Helper macro to execute a system call that returns an `io::Result`.
@@ -236,6 +246,7 @@ type IovLen = usize;
236
246
target_os = "netbsd" ,
237
247
target_os = "openbsd" ,
238
248
target_os = "solaris" ,
249
+ target_os = "nto" ,
239
250
target_vendor = "apple" ,
240
251
) ) ]
241
252
type IovLen = c_int ;
@@ -902,7 +913,7 @@ pub(crate) fn keepalive_time(fd: Socket) -> io::Result<Duration> {
902
913
903
914
#[ allow( unused_variables) ]
904
915
pub ( crate ) fn set_tcp_keepalive ( fd : Socket , keepalive : & TcpKeepalive ) -> io:: Result < ( ) > {
905
- #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" ) ) ) ]
916
+ #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" , target_os = "nto" ) ) ) ]
906
917
if let Some ( time) = keepalive. time {
907
918
let secs = into_secs ( time) ;
908
919
unsafe { setsockopt ( fd, libc:: IPPROTO_TCP , KEEPALIVE_TIME , secs) ? }
@@ -932,7 +943,7 @@ pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Res
932
943
Ok ( ( ) )
933
944
}
934
945
935
- #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" ) ) ) ]
946
+ #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" , target_os = "nto" ) ) ) ]
936
947
fn into_secs ( duration : Duration ) -> c_int {
937
948
min ( duration. as_secs ( ) , c_int:: MAX as u64 ) as c_int
938
949
}
@@ -1032,6 +1043,7 @@ pub(crate) fn from_in6_addr(addr: in6_addr) -> Ipv6Addr {
1032
1043
target_os = "openbsd" ,
1033
1044
target_os = "redox" ,
1034
1045
target_os = "solaris" ,
1046
+ target_os = "nto" ,
1035
1047
) ) ) ]
1036
1048
pub ( crate ) const fn to_mreqn (
1037
1049
multiaddr : & Ipv4Addr ,
@@ -1071,7 +1083,8 @@ impl crate::Socket {
1071
1083
target_os = "illumos" ,
1072
1084
target_os = "linux" ,
1073
1085
target_os = "netbsd" ,
1074
- target_os = "openbsd"
1086
+ target_os = "openbsd" ,
1087
+ target_os = "nto" ,
1075
1088
)
1076
1089
) ) ]
1077
1090
#[ cfg_attr(
@@ -1086,7 +1099,8 @@ impl crate::Socket {
1086
1099
target_os = "illumos" ,
1087
1100
target_os = "linux" ,
1088
1101
target_os = "netbsd" ,
1089
- target_os = "openbsd"
1102
+ target_os = "openbsd" ,
1103
+ target_os = "nto" ,
1090
1104
)
1091
1105
) ) )
1092
1106
) ]
@@ -1102,7 +1116,7 @@ impl crate::Socket {
1102
1116
target_os = "illumos" ,
1103
1117
target_os = "linux" ,
1104
1118
target_os = "netbsd" ,
1105
- target_os = "openbsd"
1119
+ target_os = "openbsd" ,
1106
1120
) ) ]
1107
1121
pub ( crate ) fn _accept4 ( & self , flags : c_int ) -> io:: Result < ( crate :: Socket , SockAddr ) > {
1108
1122
// Safety: `accept4` initialises the `SockAddr` for us.
@@ -1258,6 +1272,7 @@ impl crate::Socket {
1258
1272
target_os = "freebsd" ,
1259
1273
target_os = "fuchsia" ,
1260
1274
target_os = "linux" ,
1275
+ target_os = "nto" ,
1261
1276
)
1262
1277
) ) ]
1263
1278
#[ cfg_attr(
@@ -1269,6 +1284,7 @@ impl crate::Socket {
1269
1284
target_os = "freebsd" ,
1270
1285
target_os = "fuchsia" ,
1271
1286
target_os = "linux" ,
1287
+ target_os = "nto" ,
1272
1288
)
1273
1289
) ) )
1274
1290
) ]
0 commit comments