@@ -76,6 +76,8 @@ pub(crate) use libc::{
7676#[ cfg( not( target_os = "redox" ) ) ]
7777pub ( crate ) use libc:: { MSG_TRUNC , SO_OOBINLINE } ;
7878// Used in `Socket`.
79+ #[ cfg( not( target_os = "nto" ) ) ]
80+ pub ( crate ) use libc:: ipv6_mreq as Ipv6Mreq ;
7981#[ cfg( not( any(
8082 target_os = "dragonfly" ,
8183 target_os = "fuchsia" ,
@@ -98,6 +100,7 @@ pub(crate) use libc::IP_HDRINCL;
98100 target_os = "redox" ,
99101 target_os = "solaris" ,
100102 target_os = "haiku" ,
103+ target_os = "nto" ,
101104) ) ) ]
102105pub ( crate ) use libc:: IP_RECVTOS ;
103106#[ cfg( not( any(
@@ -112,11 +115,11 @@ pub(crate) use libc::SO_LINGER;
112115#[ cfg( target_vendor = "apple" ) ]
113116pub ( crate ) use libc:: SO_LINGER_SEC as SO_LINGER ;
114117pub ( 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 ,
120123} ;
121124#[ cfg( not( any(
122125 target_os = "dragonfly" ,
@@ -125,6 +128,7 @@ pub(crate) use libc::{
125128 target_os = "openbsd" ,
126129 target_os = "redox" ,
127130 target_os = "fuchsia" ,
131+ target_os = "nto" ,
128132) ) ) ]
129133pub ( crate ) use libc:: {
130134 ip_mreq_source as IpMreqSource , IP_ADD_SOURCE_MEMBERSHIP , IP_DROP_SOURCE_MEMBERSHIP ,
@@ -137,6 +141,7 @@ pub(crate) use libc::{
137141 target_os = "netbsd" ,
138142 target_os = "openbsd" ,
139143 target_os = "solaris" ,
144+ target_os = "nto" ,
140145 target_vendor = "apple"
141146) ) ) ]
142147pub ( crate ) use libc:: { IPV6_ADD_MEMBERSHIP , IPV6_DROP_MEMBERSHIP } ;
@@ -173,7 +178,12 @@ pub(crate) type Bool = c_int;
173178
174179#[ cfg( target_vendor = "apple" ) ]
175180use 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+ ) ) ) ]
177187use libc:: TCP_KEEPIDLE as KEEPALIVE_TIME ;
178188
179189/// Helper macro to execute a system call that returns an `io::Result`.
@@ -236,6 +246,7 @@ type IovLen = usize;
236246 target_os = "netbsd" ,
237247 target_os = "openbsd" ,
238248 target_os = "solaris" ,
249+ target_os = "nto" ,
239250 target_vendor = "apple" ,
240251) ) ]
241252type IovLen = c_int ;
@@ -902,7 +913,7 @@ pub(crate) fn keepalive_time(fd: Socket) -> io::Result<Duration> {
902913
903914#[ allow( unused_variables) ]
904915pub ( 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" ) ) ) ]
906917 if let Some ( time) = keepalive. time {
907918 let secs = into_secs ( time) ;
908919 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
932943 Ok ( ( ) )
933944}
934945
935- #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" ) ) ) ]
946+ #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" , target_os = "nto" ) ) ) ]
936947fn into_secs ( duration : Duration ) -> c_int {
937948 min ( duration. as_secs ( ) , c_int:: MAX as u64 ) as c_int
938949}
@@ -1032,6 +1043,7 @@ pub(crate) fn from_in6_addr(addr: in6_addr) -> Ipv6Addr {
10321043 target_os = "openbsd" ,
10331044 target_os = "redox" ,
10341045 target_os = "solaris" ,
1046+ target_os = "nto" ,
10351047) ) ) ]
10361048pub ( crate ) const fn to_mreqn (
10371049 multiaddr : & Ipv4Addr ,
@@ -1071,7 +1083,8 @@ impl crate::Socket {
10711083 target_os = "illumos" ,
10721084 target_os = "linux" ,
10731085 target_os = "netbsd" ,
1074- target_os = "openbsd"
1086+ target_os = "openbsd" ,
1087+ target_os = "nto" ,
10751088 )
10761089 ) ) ]
10771090 #[ cfg_attr(
@@ -1086,7 +1099,8 @@ impl crate::Socket {
10861099 target_os = "illumos" ,
10871100 target_os = "linux" ,
10881101 target_os = "netbsd" ,
1089- target_os = "openbsd"
1102+ target_os = "openbsd" ,
1103+ target_os = "nto" ,
10901104 )
10911105 ) ) )
10921106 ) ]
@@ -1102,7 +1116,7 @@ impl crate::Socket {
11021116 target_os = "illumos" ,
11031117 target_os = "linux" ,
11041118 target_os = "netbsd" ,
1105- target_os = "openbsd"
1119+ target_os = "openbsd" ,
11061120 ) ) ]
11071121 pub ( crate ) fn _accept4 ( & self , flags : c_int ) -> io:: Result < ( crate :: Socket , SockAddr ) > {
11081122 // Safety: `accept4` initialises the `SockAddr` for us.
@@ -1258,6 +1272,7 @@ impl crate::Socket {
12581272 target_os = "freebsd" ,
12591273 target_os = "fuchsia" ,
12601274 target_os = "linux" ,
1275+ target_os = "nto" ,
12611276 )
12621277 ) ) ]
12631278 #[ cfg_attr(
@@ -1269,6 +1284,7 @@ impl crate::Socket {
12691284 target_os = "freebsd" ,
12701285 target_os = "fuchsia" ,
12711286 target_os = "linux" ,
1287+ target_os = "nto" ,
12721288 )
12731289 ) ) )
12741290 ) ]
0 commit comments