@@ -85,6 +85,7 @@ pub(crate) use libc::IP_HDRINCL;
85
85
target_os = "openbsd" ,
86
86
target_os = "redox" ,
87
87
target_os = "solaris" ,
88
+ target_os = "nto" ,
88
89
) ) ) ]
89
90
pub ( crate ) use libc:: IP_RECVTOS ;
90
91
#[ cfg( not( any(
@@ -112,6 +113,7 @@ pub(crate) use libc::{
112
113
target_os = "openbsd" ,
113
114
target_os = "redox" ,
114
115
target_os = "fuchsia" ,
116
+ target_os = "nto" ,
115
117
) ) ) ]
116
118
pub ( crate ) use libc:: {
117
119
ip_mreq_source as IpMreqSource , IP_ADD_SOURCE_MEMBERSHIP , IP_DROP_SOURCE_MEMBERSHIP ,
@@ -124,7 +126,8 @@ pub(crate) use libc::{
124
126
target_os = "netbsd" ,
125
127
target_os = "openbsd" ,
126
128
target_os = "solaris" ,
127
- target_vendor = "apple"
129
+ target_vendor = "apple" ,
130
+ target_os = "nto" ,
128
131
) ) ) ]
129
132
pub ( crate ) use libc:: { IPV6_ADD_MEMBERSHIP , IPV6_DROP_MEMBERSHIP } ;
130
133
#[ cfg( any(
@@ -136,6 +139,7 @@ pub(crate) use libc::{IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP};
136
139
target_os = "openbsd" ,
137
140
target_os = "solaris" ,
138
141
target_vendor = "apple" ,
142
+ target_os = "nto" ,
139
143
) ) ]
140
144
pub ( crate ) use libc:: {
141
145
IPV6_JOIN_GROUP as IPV6_ADD_MEMBERSHIP , IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP ,
@@ -158,9 +162,14 @@ pub(crate) use libc::{TCP_KEEPCNT, TCP_KEEPINTVL};
158
162
// See this type in the Windows file.
159
163
pub ( crate ) type Bool = c_int ;
160
164
161
- #[ cfg( target_vendor = "apple" ) ]
165
+ #[ cfg( any ( target_vendor = "apple" , target_os = "nto" ) ) ]
162
166
use libc:: TCP_KEEPALIVE as KEEPALIVE_TIME ;
163
- #[ cfg( not( any( target_vendor = "apple" , target_os = "haiku" , target_os = "openbsd" ) ) ) ]
167
+ #[ cfg( not( any(
168
+ target_vendor = "apple" ,
169
+ target_os = "haiku" ,
170
+ target_os = "openbsd" ,
171
+ target_os = "nto"
172
+ ) ) ) ]
164
173
use libc:: TCP_KEEPIDLE as KEEPALIVE_TIME ;
165
174
166
175
/// Helper macro to execute a system call that returns an `io::Result`.
@@ -220,6 +229,7 @@ type IovLen = usize;
220
229
target_os = "openbsd" ,
221
230
target_os = "solaris" ,
222
231
target_vendor = "apple" ,
232
+ target_os = "nto" ,
223
233
) ) ]
224
234
type IovLen = c_int ;
225
235
@@ -316,7 +326,8 @@ impl Type {
316
326
target_os = "illumos" ,
317
327
target_os = "linux" ,
318
328
target_os = "netbsd" ,
319
- target_os = "openbsd"
329
+ target_os = "openbsd" ,
330
+ target_os = "nto" , /* From 7.0 up */
320
331
)
321
332
) ) ]
322
333
#[ cfg_attr(
@@ -331,7 +342,8 @@ impl Type {
331
342
target_os = "illumos" ,
332
343
target_os = "linux" ,
333
344
target_os = "netbsd" ,
334
- target_os = "openbsd"
345
+ target_os = "openbsd" ,
346
+ target_os = "nto" ,
335
347
)
336
348
) ) )
337
349
) ]
@@ -347,7 +359,8 @@ impl Type {
347
359
target_os = "illumos" ,
348
360
target_os = "linux" ,
349
361
target_os = "netbsd" ,
350
- target_os = "openbsd"
362
+ target_os = "openbsd" ,
363
+ target_os = "nto" ,
351
364
) ) ]
352
365
pub ( crate ) const fn _cloexec ( self ) -> Type {
353
366
Type ( self . 0 | libc:: SOCK_CLOEXEC )
@@ -930,6 +943,12 @@ pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Res
930
943
}
931
944
}
932
945
946
+ #[ cfg( target_os = "nto" ) ]
947
+ if let Some ( time) = keepalive. time {
948
+ let secs = into_timeval ( Some ( time) ) ;
949
+ unsafe { setsockopt ( fd, libc:: IPPROTO_TCP , KEEPALIVE_TIME , secs) ? }
950
+ }
951
+
933
952
Ok ( ( ) )
934
953
}
935
954
@@ -1028,6 +1047,7 @@ pub(crate) fn from_in6_addr(addr: in6_addr) -> Ipv6Addr {
1028
1047
target_os = "openbsd" ,
1029
1048
target_os = "redox" ,
1030
1049
target_os = "solaris" ,
1050
+ target_os = "nto" ,
1031
1051
) ) ) ]
1032
1052
pub ( crate ) fn to_mreqn (
1033
1053
multiaddr : & Ipv4Addr ,
@@ -1197,6 +1217,7 @@ impl crate::Socket {
1197
1217
target_os = "freebsd" ,
1198
1218
target_os = "fuchsia" ,
1199
1219
target_os = "linux" ,
1220
+ target_os = "nto" ,
1200
1221
)
1201
1222
) ) ]
1202
1223
#[ cfg_attr(
@@ -1208,6 +1229,7 @@ impl crate::Socket {
1208
1229
target_os = "freebsd" ,
1209
1230
target_os = "fuchsia" ,
1210
1231
target_os = "linux" ,
1232
+ target_os = "nto" ,
1211
1233
)
1212
1234
) ) )
1213
1235
) ]
0 commit comments