Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ pub struct TcpKeepalive {
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "haiku",
Expand All @@ -460,7 +460,7 @@ pub struct TcpKeepalive {
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "haiku",
Expand All @@ -479,7 +479,7 @@ impl TcpKeepalive {
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "haiku",
Expand All @@ -490,7 +490,7 @@ impl TcpKeepalive {
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "haiku",
Expand Down
6 changes: 3 additions & 3 deletions src/sockaddr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ impl From<SocketAddrV4> for SockAddr {
target_os = "visionos",
target_os = "macos",
target_os = "netbsd",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "openbsd",
target_os = "tvos",
target_os = "vxworks",
Expand Down Expand Up @@ -414,7 +414,7 @@ impl From<SocketAddrV6> for SockAddr {
target_os = "visionos",
target_os = "macos",
target_os = "netbsd",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "openbsd",
target_os = "tvos",
target_os = "vxworks",
Expand All @@ -439,7 +439,7 @@ impl fmt::Debug for SockAddr {
target_os = "visionos",
target_os = "macos",
target_os = "netbsd",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "openbsd",
target_os = "tvos",
target_os = "vxworks",
Expand Down
27 changes: 18 additions & 9 deletions src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ use std::io::{self, Read, Write};
#[cfg(not(any(target_os = "redox", target_os = "wasi", target_os = "horizon")))]
use std::io::{IoSlice, IoSliceMut};
use std::mem::MaybeUninit;
#[cfg(not(any(target_os = "nto", target_os = "nuttx")))]
#[cfg(not(any(
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "nuttx"
)))]
use std::net::Ipv6Addr;
use std::net::{self, Ipv4Addr, Shutdown};
#[cfg(any(unix, all(target_os = "wasi", not(target_env = "p1"))))]
Expand Down Expand Up @@ -1351,7 +1354,7 @@ impl Socket {
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "cygwin",
Expand Down Expand Up @@ -1387,7 +1390,7 @@ impl Socket {
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "cygwin",
Expand Down Expand Up @@ -1425,7 +1428,7 @@ impl Socket {
target_os = "openbsd",
target_os = "redox",
target_os = "fuchsia",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "wasi",
Expand Down Expand Up @@ -1465,7 +1468,7 @@ impl Socket {
target_os = "openbsd",
target_os = "redox",
target_os = "fuchsia",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "wasi",
Expand Down Expand Up @@ -1686,7 +1689,7 @@ impl Socket {
target_os = "redox",
target_os = "solaris",
target_os = "haiku",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "nuttx",
target_os = "vita",
Expand Down Expand Up @@ -1721,7 +1724,7 @@ impl Socket {
target_os = "redox",
target_os = "solaris",
target_os = "haiku",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "nuttx",
target_os = "vita",
Expand Down Expand Up @@ -1870,7 +1873,10 @@ impl Socket {
/// This function specifies a new multicast group for this socket to join.
/// The address must be a valid multicast address, and `interface` is the
/// index of the interface to join/leave (or 0 to indicate any interface).
#[cfg(not(any(target_os = "nto", target_os = "nuttx")))]
#[cfg(not(any(
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "nuttx"
)))]
pub fn join_multicast_v6(&self, multiaddr: &Ipv6Addr, interface: u32) -> io::Result<()> {
let mreq = sys::Ipv6Mreq {
ipv6mr_multiaddr: sys::to_in6_addr(multiaddr),
Expand All @@ -1894,7 +1900,10 @@ impl Socket {
/// For more information about this option, see [`join_multicast_v6`].
///
/// [`join_multicast_v6`]: Socket::join_multicast_v6
#[cfg(not(any(target_os = "nto", target_os = "nuttx")))]
#[cfg(not(any(
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "nuttx"
)))]
pub fn leave_multicast_v6(&self, multiaddr: &Ipv6Addr, interface: u32) -> io::Result<()> {
let mreq = sys::Ipv6Mreq {
ipv6mr_multiaddr: sys::to_in6_addr(multiaddr),
Expand Down
25 changes: 17 additions & 8 deletions src/sys/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ pub(crate) use libc::MSG_TRUNC;
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
pub(crate) use libc::SO_OOBINLINE;
// Used in `Socket`.
#[cfg(not(any(target_os = "nto", target_os = "nuttx")))]
#[cfg(not(any(
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "nuttx"
)))]
pub(crate) use libc::ipv6_mreq as Ipv6Mreq;
#[cfg(all(feature = "all", target_os = "linux"))]
pub(crate) use libc::IPV6_HDRINCL;
Expand Down Expand Up @@ -198,7 +201,7 @@ pub(crate) use libc::IP_HDRINCL;
target_os = "solaris",
target_os = "haiku",
target_os = "hurd",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "nuttx",
target_os = "vita",
Expand Down Expand Up @@ -252,7 +255,7 @@ pub(crate) use libc::{
target_os = "openbsd",
target_os = "redox",
target_os = "fuchsia",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "wasi",
Expand All @@ -270,7 +273,8 @@ pub(crate) use libc::{
target_os = "visionos",
target_os = "macos",
target_os = "netbsd",
target_os = "nto",
all(target_os = "nto", target_env = "nto71_iosock"),
target_os = "qnx",
target_os = "openbsd",
target_os = "solaris",
target_os = "tvos",
Expand All @@ -289,6 +293,8 @@ pub(crate) use libc::{IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP};
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
all(target_os = "nto", target_env = "nto71_iosock"),
target_os = "qnx",
target_os = "solaris",
target_os = "tvos",
target_os = "watchos",
Expand Down Expand Up @@ -427,6 +433,7 @@ type IovLen = usize;
target_os = "macos",
target_os = "netbsd",
target_os = "nto",
target_os = "qnx",
target_os = "openbsd",
target_os = "solaris",
target_os = "tvos",
Expand Down Expand Up @@ -1277,7 +1284,7 @@ pub(crate) fn set_tcp_keepalive(fd: RawSocket, keepalive: &TcpKeepalive) -> io::
#[cfg(not(any(
target_os = "haiku",
target_os = "openbsd",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "vita"
)))]
if let Some(time) = keepalive.time {
Expand All @@ -1297,6 +1304,8 @@ pub(crate) fn set_tcp_keepalive(fd: RawSocket, keepalive: &TcpKeepalive) -> io::
target_os = "ios",
target_os = "visionos",
target_os = "linux",
all(target_os = "nto", target_env = "nto71_iosock"),
target_os = "qnx",
target_os = "macos",
target_os = "netbsd",
target_os = "tvos",
Expand All @@ -1316,7 +1325,7 @@ pub(crate) fn set_tcp_keepalive(fd: RawSocket, keepalive: &TcpKeepalive) -> io::
}
}

#[cfg(target_os = "nto")]
#[cfg(all(target_os = "nto", not(target_env = "nto71_iosock")))]
if let Some(time) = keepalive.time {
let secs = into_timeval(Some(time));
unsafe { setsockopt(fd, libc::IPPROTO_TCP, KEEPALIVE_TIME, secs)? }
Expand All @@ -1328,7 +1337,7 @@ pub(crate) fn set_tcp_keepalive(fd: RawSocket, keepalive: &TcpKeepalive) -> io::
#[cfg(not(any(
target_os = "haiku",
target_os = "openbsd",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "vita"
)))]
fn into_secs(duration: Duration) -> c_int {
Expand Down Expand Up @@ -1434,7 +1443,7 @@ pub(crate) fn from_in6_addr(addr: in6_addr) -> Ipv6Addr {
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
target_os = "nto",
all(target_os = "nto", not(target_env = "nto71_iosock")),
target_os = "espidf",
target_os = "vita",
target_os = "cygwin",
Expand Down
Loading