diff --git a/Cargo.toml b/Cargo.toml index 0943a6cec..f2f57828a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -263,6 +263,7 @@ check-cfg = [ 'cfg(lower_upper_exp_for_non_zero)', 'cfg(sanitize_memory)', 'cfg(netbsdlike)', + 'cfg(nto)', 'cfg(rustc_diagnostics)', 'cfg(solarish)', 'cfg(staged_api)', diff --git a/build.rs b/build.rs index 0bde91294..bc92fbf2e 100644 --- a/build.rs +++ b/build.rs @@ -150,6 +150,12 @@ fn main() { if os == "solaris" || os == "illumos" { use_feature("solarish"); } + // QNX Neutrino. QNX 7.x and the QNX SDP 8.0 toolchain targets say `target_os = "nto"`; + // upstream Rust's QNX 8.0 targets (`x86_64-pc-qnx`, `aarch64-unknown-qnx`) say + // `target_os = "qnx"`. libc puts both in its `nto` module. + if os == "nto" || os == "qnx" { + use_feature("nto"); + } if apple || freebsdlike || netbsdlike { use_feature("bsd"); } diff --git a/examples/stdio.rs b/examples/stdio.rs index 81e6a95a4..97788c33f 100644 --- a/examples/stdio.rs +++ b/examples/stdio.rs @@ -93,13 +93,7 @@ fn show(fd: Fd) -> io::Result<()> { if term.input_modes.contains(InputModes::ICRNL) { print!(" ICRNL"); } - #[cfg(any( - linux_kernel, - solarish, - target_os = "aix", - target_os = "haiku", - target_os = "nto" - ))] + #[cfg(any(linux_kernel, solarish, target_os = "aix", target_os = "haiku", nto))] if term.input_modes.contains(InputModes::IUCLC) { print!(" IUCLC"); } @@ -301,7 +295,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "aix", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, )))] println!( " VSWTC={}", diff --git a/src/backend/libc/fs/dir.rs b/src/backend/libc/fs/dir.rs index 19a909078..3616155ed 100644 --- a/src/backend/libc/fs/dir.rs +++ b/src/backend/libc/fs/dir.rs @@ -2,7 +2,7 @@ solarish, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "vita" )))] use super::types::FileType; @@ -18,7 +18,7 @@ use crate::fs::{fstat, Stat}; target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -205,7 +205,7 @@ impl Dir { solarish, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "vita" )))] d_type: dirent.d_type, @@ -247,7 +247,7 @@ impl Dir { target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -323,7 +323,7 @@ pub struct DirEntry { solarish, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "vita" )))] d_type: u8, @@ -375,7 +375,7 @@ impl DirEntry { solarish, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "vita" )))] #[inline] diff --git a/src/backend/libc/fs/syscalls.rs b/src/backend/libc/fs/syscalls.rs index 5b8962f98..6c1ec8ba4 100644 --- a/src/backend/libc/fs/syscalls.rs +++ b/src/backend/libc/fs/syscalls.rs @@ -19,7 +19,7 @@ use crate::fs::AtFlags; target_os = "dragonfly", target_os = "espidf", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -43,7 +43,7 @@ use crate::fs::SealFlags; target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -255,7 +255,7 @@ pub(crate) fn openat( target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -1609,7 +1609,7 @@ fn fstat_old(fd: BorrowedFd<'_>) -> io::Result { target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -1754,7 +1754,7 @@ fn futimens_old(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> { target_os = "dragonfly", target_os = "espidf", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] diff --git a/src/backend/libc/fs/types.rs b/src/backend/libc/fs/types.rs index 70c68d077..7c6de9488 100644 --- a/src/backend/libc/fs/types.rs +++ b/src/backend/libc/fs/types.rs @@ -631,7 +631,7 @@ impl FileType { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "vita" )))] #[inline] @@ -776,7 +776,7 @@ bitflags! { netbsdlike, target_os = "espidf", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita" )))] @@ -1071,7 +1071,7 @@ pub struct Stat { target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -1093,7 +1093,7 @@ pub type StatFs = c::statfs64; target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", diff --git a/src/backend/libc/io/errno.rs b/src/backend/libc/io/errno.rs index 81f0e4893..864724bdd 100644 --- a/src/backend/libc/io/errno.rs +++ b/src/backend/libc/io/errno.rs @@ -246,7 +246,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -282,7 +282,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -333,7 +333,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -350,7 +350,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -367,7 +367,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -384,7 +384,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -537,7 +537,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -567,7 +567,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -648,7 +648,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -670,7 +670,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -773,7 +773,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -902,7 +902,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] @@ -934,7 +934,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -1034,7 +1034,7 @@ impl Errno { target_os = "horizon", target_os = "hurd", target_os = "l4re", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] diff --git a/src/backend/libc/io/syscalls.rs b/src/backend/libc/io/syscalls.rs index 4b44b1b5d..df1b3d47c 100644 --- a/src/backend/libc/io/syscalls.rs +++ b/src/backend/libc/io/syscalls.rs @@ -9,7 +9,7 @@ use crate::fd::{AsFd as _, BorrowedFd, OwnedFd, RawFd}; target_os = "aix", target_os = "espidf", target_os = "horizon", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi" )))] @@ -98,7 +98,7 @@ pub(crate) fn writev(fd: BorrowedFd<'_>, bufs: &[IoSlice<'_>]) -> io::Result, new: &mut OwnedFd) -> io::Result<()> { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", diff --git a/src/backend/libc/mm/types.rs b/src/backend/libc/mm/types.rs index 6f7d24f5a..0c5389e1d 100644 --- a/src/backend/libc/mm/types.rs +++ b/src/backend/libc/mm/types.rs @@ -87,7 +87,7 @@ bitflags! { target_os = "fuchsia", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const SHARED_VALIDATE = bitcast!(c::MAP_SHARED_VALIDATE); @@ -101,7 +101,7 @@ bitflags! { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const DENYWRITE = bitcast!(c::MAP_DENYWRITE); @@ -118,7 +118,7 @@ bitflags! { target_os = "fuchsia", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const FIXED_NOREPLACE = bitcast!(c::MAP_FIXED_NOREPLACE); @@ -130,7 +130,7 @@ bitflags! { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const GROWSDOWN = bitcast!(c::MAP_GROWSDOWN); @@ -142,7 +142,7 @@ bitflags! { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const HUGETLB = bitcast!(c::MAP_HUGETLB); @@ -157,7 +157,7 @@ bitflags! { target_os = "fuchsia", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const HUGE_2MB = bitcast!(c::MAP_HUGE_2MB); @@ -172,7 +172,7 @@ bitflags! { target_os = "fuchsia", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const HUGE_1GB = bitcast!(c::MAP_HUGE_1GB); @@ -184,7 +184,7 @@ bitflags! { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const LOCKED = bitcast!(c::MAP_LOCKED); @@ -196,7 +196,7 @@ bitflags! { freebsdlike, target_os = "aix", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const NORESERVE = bitcast!(c::MAP_NORESERVE); @@ -211,7 +211,7 @@ bitflags! { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const POPULATE = bitcast!(c::MAP_POPULATE); @@ -240,7 +240,7 @@ bitflags! { target_os = "fuchsia", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", all( linux_kernel, diff --git a/src/backend/libc/mod.rs b/src/backend/libc/mod.rs index b4fd3ef46..7efb54c4c 100644 --- a/src/backend/libc/mod.rs +++ b/src/backend/libc/mod.rs @@ -205,7 +205,7 @@ pub(crate) mod ugid; #[cfg(bsd)] const MAX_IOV: usize = c::IOV_MAX as usize; -#[cfg(any(linux_kernel, target_os = "emscripten", target_os = "nto"))] +#[cfg(any(linux_kernel, target_os = "emscripten", nto))] const MAX_IOV: usize = c::UIO_MAXIOV as usize; #[cfg(not(any( @@ -214,7 +214,7 @@ const MAX_IOV: usize = c::UIO_MAXIOV as usize; windows, target_os = "emscripten", target_os = "espidf", - target_os = "nto", + nto, target_os = "horizon", )))] const MAX_IOV: usize = 16; // The minimum value required by POSIX. diff --git a/src/backend/libc/net/addr.rs b/src/backend/libc/net/addr.rs index a9b55559c..72c373c1c 100644 --- a/src/backend/libc/net/addr.rs +++ b/src/backend/libc/net/addr.rs @@ -108,21 +108,21 @@ impl SocketAddrUnix { target_os = "aix", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "hurd", ))] sun_len: 0, #[cfg(target_os = "vita")] ss_len: 0, sun_family: c::AF_UNIX as _, - #[cfg(any(bsd, target_os = "horizon", target_os = "nto"))] + #[cfg(any(bsd, target_os = "horizon", nto))] sun_path: [0; 104], #[cfg(not(any( bsd, target_os = "aix", target_os = "haiku", target_os = "horizon", - target_os = "nto" + nto )))] sun_path: [0; 108], #[cfg(target_os = "haiku")] @@ -349,7 +349,7 @@ pub(crate) fn offsetof_sun_path() -> usize { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, ))] sun_len: 0_u8, #[cfg(target_os = "vita")] @@ -360,7 +360,7 @@ pub(crate) fn offsetof_sun_path() -> usize { target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita" ))] sun_family: 0_u8, @@ -370,18 +370,18 @@ pub(crate) fn offsetof_sun_path() -> usize { target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita" )))] sun_family: 0_u16, - #[cfg(any(bsd, target_os = "horizon", target_os = "nto"))] + #[cfg(any(bsd, target_os = "horizon", nto))] sun_path: [0; 104], #[cfg(not(any( bsd, target_os = "aix", target_os = "haiku", target_os = "horizon", - target_os = "nto" + nto )))] sun_path: [0; 108], #[cfg(target_os = "haiku")] diff --git a/src/backend/libc/net/ext.rs b/src/backend/libc/net/ext.rs index efd2b31c8..4e52850cf 100644 --- a/src/backend/libc/net/ext.rs +++ b/src/backend/libc/net/ext.rs @@ -84,7 +84,7 @@ pub(crate) const fn sockaddr_in6_new( target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita" ))] sin6_len: u8, @@ -101,7 +101,7 @@ pub(crate) const fn sockaddr_in6_new( target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita" ))] sin6_len, diff --git a/src/backend/libc/net/msghdr.rs b/src/backend/libc/net/msghdr.rs index f46ac7e29..40ae78050 100644 --- a/src/backend/libc/net/msghdr.rs +++ b/src/backend/libc/net/msghdr.rs @@ -58,7 +58,7 @@ fn msg_iov_len(len: usize) -> c::c_int { target_os = "fuchsia", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, ))] #[inline] fn msg_control_len(len: usize) -> c::socklen_t { @@ -78,7 +78,7 @@ fn msg_control_len(len: usize) -> c::socklen_t { target_os = "fuchsia", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi", )))] diff --git a/src/backend/libc/net/read_sockaddr.rs b/src/backend/libc/net/read_sockaddr.rs index 5f8c48ec7..2f4884a19 100644 --- a/src/backend/libc/net/read_sockaddr.rs +++ b/src/backend/libc/net/read_sockaddr.rs @@ -24,7 +24,7 @@ pub(crate) struct sockaddr_header { target_os = "aix", target_os = "espidf", target_os = "haiku", - target_os = "nto", + nto, target_os = "vita" ))] sa_len: u8, @@ -33,7 +33,7 @@ pub(crate) struct sockaddr_header { target_os = "aix", target_os = "espidf", target_os = "haiku", - target_os = "nto", + nto, target_os = "vita" ))] sa_family: u8, @@ -42,7 +42,7 @@ pub(crate) struct sockaddr_header { target_os = "aix", target_os = "espidf", target_os = "haiku", - target_os = "nto", + nto, target_os = "vita" )))] sa_family: u16, @@ -63,7 +63,7 @@ pub(crate) unsafe fn read_sa_family(storage: *const c::sockaddr) -> u16 { target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita" ))] sa_len: 0_u8, @@ -73,7 +73,7 @@ pub(crate) unsafe fn read_sa_family(storage: *const c::sockaddr) -> u16 { target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita" ))] sa_family: 0_u8, @@ -83,7 +83,7 @@ pub(crate) unsafe fn read_sa_family(storage: *const c::sockaddr) -> u16 { target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita" )))] sa_family: 0_u16, diff --git a/src/backend/libc/net/send_recv.rs b/src/backend/libc/net/send_recv.rs index 4b67f2c5b..b0ab9b0d8 100644 --- a/src/backend/libc/net/send_recv.rs +++ b/src/backend/libc/net/send_recv.rs @@ -18,7 +18,7 @@ bitflags! { target_os = "aix", target_os = "cygwin", target_os = "espidf", - target_os = "nto", + nto, target_os = "haiku", target_os = "horizon", target_os = "hurd", @@ -43,7 +43,7 @@ bitflags! { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -77,7 +77,7 @@ bitflags! { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -96,7 +96,7 @@ bitflags! { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] diff --git a/src/backend/libc/net/sockopt.rs b/src/backend/libc/net/sockopt.rs index 286adde62..962df7e9b 100644 --- a/src/backend/libc/net/sockopt.rs +++ b/src/backend/libc/net/sockopt.rs @@ -29,7 +29,7 @@ use crate::net::xdp::{XdpMmapOffsets, XdpOptionsFlags, XdpRingOffset, XdpStatist target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "vita", )))] use crate::net::AddressFamily; @@ -79,7 +79,7 @@ use alloc::borrow::ToOwned as _; use alloc::string::String; #[cfg(apple)] use c::TCP_KEEPALIVE as TCP_KEEPIDLE; -#[cfg(not(any(apple, target_os = "haiku", target_os = "nto", target_os = "openbsd")))] +#[cfg(not(any(apple, target_os = "haiku", nto, target_os = "openbsd")))] use c::TCP_KEEPIDLE; use core::mem::{size_of, MaybeUninit}; use core::time::Duration; @@ -394,7 +394,7 @@ pub(crate) fn socket_send_buffer_size(fd: BorrowedFd<'_>) -> io::Result { target_os = "horizon", target_os = "hurd", target_os = "netbsd", - target_os = "nto", + nto, target_os = "vita", )))] pub(crate) fn socket_domain(fd: BorrowedFd<'_>) -> io::Result { @@ -684,21 +684,9 @@ pub(crate) fn set_ipv6_add_membership( multiaddr: &Ipv6Addr, interface: u32, ) -> io::Result<()> { - #[cfg(not(any( - bsd, - solarish, - target_os = "haiku", - target_os = "l4re", - target_os = "nto" - )))] + #[cfg(not(any(bsd, solarish, target_os = "haiku", target_os = "l4re", nto)))] use c::IPV6_ADD_MEMBERSHIP; - #[cfg(any( - bsd, - solarish, - target_os = "haiku", - target_os = "l4re", - target_os = "nto" - ))] + #[cfg(any(bsd, solarish, target_os = "haiku", target_os = "l4re", nto))] use c::IPV6_JOIN_GROUP as IPV6_ADD_MEMBERSHIP; let mreq = to_ipv6mr(multiaddr, interface); @@ -739,21 +727,9 @@ pub(crate) fn set_ipv6_drop_membership( multiaddr: &Ipv6Addr, interface: u32, ) -> io::Result<()> { - #[cfg(not(any( - bsd, - solarish, - target_os = "haiku", - target_os = "l4re", - target_os = "nto" - )))] + #[cfg(not(any(bsd, solarish, target_os = "haiku", target_os = "l4re", nto)))] use c::IPV6_DROP_MEMBERSHIP; - #[cfg(any( - bsd, - solarish, - target_os = "haiku", - target_os = "l4re", - target_os = "nto" - ))] + #[cfg(any(bsd, solarish, target_os = "haiku", target_os = "l4re", nto))] use c::IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP; let mreq = to_ipv6mr(multiaddr, interface); @@ -780,7 +756,7 @@ pub(crate) fn set_ipv6_unicast_hops(fd: BorrowedFd<'_>, hops: Option) -> io: target_os = "aix", target_os = "fuchsia", target_os = "haiku", - target_os = "nto", + nto, target_env = "newlib" ))] #[inline] @@ -794,7 +770,7 @@ pub(crate) fn set_ip_tos(fd: BorrowedFd<'_>, value: u8) -> io::Result<()> { target_os = "aix", target_os = "fuchsia", target_os = "haiku", - target_os = "nto", + nto, target_env = "newlib" ))] #[inline] @@ -827,25 +803,13 @@ pub(crate) fn ip_recvtos(fd: BorrowedFd<'_>) -> io::Result { getsockopt(fd, c::IPPROTO_IP, c::IP_RECVTOS).map(to_bool) } -#[cfg(any( - bsd, - linux_like, - target_os = "aix", - target_os = "fuchsia", - target_os = "nto" -))] +#[cfg(any(bsd, linux_like, target_os = "aix", target_os = "fuchsia", nto))] #[inline] pub(crate) fn set_ipv6_recvtclass(fd: BorrowedFd<'_>, value: bool) -> io::Result<()> { setsockopt(fd, c::IPPROTO_IPV6, c::IPV6_RECVTCLASS, from_bool(value)) } -#[cfg(any( - bsd, - linux_like, - target_os = "aix", - target_os = "fuchsia", - target_os = "nto" -))] +#[cfg(any(bsd, linux_like, target_os = "aix", target_os = "fuchsia", nto))] #[inline] pub(crate) fn ipv6_recvtclass(fd: BorrowedFd<'_>) -> io::Result { getsockopt(fd, c::IPPROTO_IPV6, c::IPV6_RECVTCLASS).map(to_bool) @@ -936,60 +900,40 @@ pub(crate) fn tcp_nodelay(fd: BorrowedFd<'_>) -> io::Result { } #[inline] -#[cfg(not(any( - target_os = "haiku", - target_os = "nto", - target_os = "openbsd", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd", target_os = "redox")))] pub(crate) fn set_tcp_keepcnt(fd: BorrowedFd<'_>, count: u32) -> io::Result<()> { setsockopt(fd, c::IPPROTO_TCP, c::TCP_KEEPCNT, count) } #[inline] -#[cfg(not(any( - target_os = "haiku", - target_os = "nto", - target_os = "openbsd", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd", target_os = "redox")))] pub(crate) fn tcp_keepcnt(fd: BorrowedFd<'_>) -> io::Result { getsockopt(fd, c::IPPROTO_TCP, c::TCP_KEEPCNT) } #[inline] -#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd")))] pub(crate) fn set_tcp_keepidle(fd: BorrowedFd<'_>, duration: Duration) -> io::Result<()> { let secs: c::c_uint = duration_to_secs(duration)?; setsockopt(fd, c::IPPROTO_TCP, TCP_KEEPIDLE, secs) } #[inline] -#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd")))] pub(crate) fn tcp_keepidle(fd: BorrowedFd<'_>) -> io::Result { let secs: c::c_uint = getsockopt(fd, c::IPPROTO_TCP, TCP_KEEPIDLE)?; Ok(Duration::from_secs(secs as u64)) } #[inline] -#[cfg(not(any( - target_os = "haiku", - target_os = "nto", - target_os = "openbsd", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd", target_os = "redox")))] pub(crate) fn set_tcp_keepintvl(fd: BorrowedFd<'_>, duration: Duration) -> io::Result<()> { let secs: c::c_uint = duration_to_secs(duration)?; setsockopt(fd, c::IPPROTO_TCP, c::TCP_KEEPINTVL, secs) } #[inline] -#[cfg(not(any( - target_os = "haiku", - target_os = "nto", - target_os = "openbsd", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd", target_os = "redox")))] pub(crate) fn tcp_keepintvl(fd: BorrowedFd<'_>) -> io::Result { let secs: c::c_uint = getsockopt(fd, c::IPPROTO_TCP, c::TCP_KEEPINTVL)?; Ok(Duration::from_secs(secs as u64)) diff --git a/src/backend/libc/net/syscalls.rs b/src/backend/libc/net/syscalls.rs index e9138143d..f3114004d 100644 --- a/src/backend/libc/net/syscalls.rs +++ b/src/backend/libc/net/syscalls.rs @@ -288,7 +288,7 @@ pub(crate) fn sendmmsg( target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -323,7 +323,7 @@ pub(crate) fn acceptfrom(sockfd: BorrowedFd<'_>) -> io::Result<(OwnedFd, Option< target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -352,7 +352,7 @@ pub(crate) fn acceptfrom_with( target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", ))] @@ -369,7 +369,7 @@ pub(crate) fn accept_with(sockfd: BorrowedFd<'_>, _flags: SocketFlags) -> io::Re target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", ))] diff --git a/src/backend/libc/net/write_sockaddr.rs b/src/backend/libc/net/write_sockaddr.rs index 08f04646c..6f48ef58c 100644 --- a/src/backend/libc/net/write_sockaddr.rs +++ b/src/backend/libc/net/write_sockaddr.rs @@ -13,7 +13,7 @@ pub(crate) fn encode_sockaddr_v4(v4: &SocketAddrV4) -> c::sockaddr_in { target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita", ))] sin_len: core::mem::size_of::() as _, @@ -38,7 +38,7 @@ pub(crate) fn encode_sockaddr_v6(v6: &SocketAddrV6) -> c::sockaddr_in6 { target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita" ))] { @@ -57,7 +57,7 @@ pub(crate) fn encode_sockaddr_v6(v6: &SocketAddrV6) -> c::sockaddr_in6 { target_os = "espidf", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita" )))] { diff --git a/src/backend/libc/pipe/syscalls.rs b/src/backend/libc/pipe/syscalls.rs index 42e56de79..0a2d95915 100644 --- a/src/backend/libc/pipe/syscalls.rs +++ b/src/backend/libc/pipe/syscalls.rs @@ -8,7 +8,7 @@ use crate::io; target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "wasi" )))] use crate::pipe::PipeFlags; @@ -39,7 +39,7 @@ pub(crate) fn pipe() -> io::Result<(OwnedFd, OwnedFd)> { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "wasi" )))] pub(crate) fn pipe_with(flags: PipeFlags) -> io::Result<(OwnedFd, OwnedFd)> { diff --git a/src/backend/libc/pipe/types.rs b/src/backend/libc/pipe/types.rs index 38e255169..3986c32cf 100644 --- a/src/backend/libc/pipe/types.rs +++ b/src/backend/libc/pipe/types.rs @@ -22,7 +22,7 @@ bitflags! { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "openbsd", target_os = "redox", target_os = "vita", diff --git a/src/backend/libc/process/types.rs b/src/backend/libc/process/types.rs index 6097b46fd..ec8bbce4c 100644 --- a/src/backend/libc/process/types.rs +++ b/src/backend/libc/process/types.rs @@ -40,13 +40,7 @@ pub enum Resource { Core = bitcast!(c::RLIMIT_CORE), /// `RLIMIT_RSS` // "nto" has `RLIMIT_RSS`, but it has the same value as `RLIMIT_AS`. - #[cfg(not(any( - apple, - solarish, - target_os = "cygwin", - target_os = "haiku", - target_os = "nto", - )))] + #[cfg(not(any(apple, solarish, target_os = "cygwin", target_os = "haiku", nto,)))] Rss = bitcast!(c::RLIMIT_RSS), /// `RLIMIT_NPROC` #[cfg(not(any(solarish, target_os = "cygwin", target_os = "haiku")))] @@ -67,7 +61,7 @@ pub enum Resource { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, )))] Locks = bitcast!(c::RLIMIT_LOCKS), /// `RLIMIT_SIGPENDING` @@ -78,7 +72,7 @@ pub enum Resource { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, )))] Sigpending = bitcast!(c::RLIMIT_SIGPENDING), /// `RLIMIT_MSGQUEUE` @@ -89,7 +83,7 @@ pub enum Resource { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, )))] Msgqueue = bitcast!(c::RLIMIT_MSGQUEUE), /// `RLIMIT_NICE` @@ -100,7 +94,7 @@ pub enum Resource { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, )))] Nice = bitcast!(c::RLIMIT_NICE), /// `RLIMIT_RTPRIO` @@ -111,7 +105,7 @@ pub enum Resource { target_os = "cygwin", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, )))] Rtprio = bitcast!(c::RLIMIT_RTPRIO), /// `RLIMIT_RTTIME` @@ -124,7 +118,7 @@ pub enum Resource { target_os = "emscripten", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, )))] Rttime = bitcast!(c::RLIMIT_RTTIME), } diff --git a/src/backend/libc/termios/syscalls.rs b/src/backend/libc/termios/syscalls.rs index 5278a989c..f2aca29ed 100644 --- a/src/backend/libc/termios/syscalls.rs +++ b/src/backend/libc/termios/syscalls.rs @@ -367,7 +367,7 @@ pub(crate) fn tcgetwinsize(fd: BorrowedFd<'_>) -> io::Result { } } -#[cfg(not(any(target_os = "espidf", target_os = "nto", target_os = "wasi")))] +#[cfg(not(any(target_os = "espidf", nto, target_os = "wasi")))] #[inline] pub(crate) fn set_speed(termios: &mut Termios, arbitrary_speed: u32) -> io::Result<()> { #[cfg(bsd)] @@ -489,7 +489,7 @@ pub(crate) fn set_input_speed(termios: &mut Termios, arbitrary_speed: u32) -> io } } -#[cfg(not(any(target_os = "espidf", target_os = "nto", target_os = "wasi")))] +#[cfg(not(any(target_os = "espidf", nto, target_os = "wasi")))] #[inline] pub(crate) fn cfmakeraw(termios: &mut Termios) { unsafe { diff --git a/src/fs/abs.rs b/src/fs/abs.rs index 6642fee65..33be26168 100644 --- a/src/fs/abs.rs +++ b/src/fs/abs.rs @@ -9,7 +9,7 @@ use crate::fs::Access; target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -260,7 +260,7 @@ pub fn access(path: P, access: Access) -> io::Result<()> { target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", diff --git a/src/fs/constants.rs b/src/fs/constants.rs index 097435ea5..e6003613c 100644 --- a/src/fs/constants.rs +++ b/src/fs/constants.rs @@ -276,7 +276,7 @@ mod tests { solarish, target_os = "cygwin", target_os = "haiku", - target_os = "nto", + nto, target_os = "redox", target_os = "wasi", )))] diff --git a/src/fs/fd.rs b/src/fs/fd.rs index 782a0f9e0..348093405 100644 --- a/src/fs/fd.rs +++ b/src/fs/fd.rs @@ -12,7 +12,7 @@ use backend::fd::AsFd; target_os = "dragonfly", target_os = "espidf", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -34,7 +34,7 @@ use backend::fs::types::Stat; target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -172,7 +172,7 @@ pub fn fstat(fd: Fd) -> io::Result { target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", target_os = "wasi", @@ -241,7 +241,7 @@ pub fn futimens(fd: Fd, times: &Timestamps) -> io::Result<()> { target_os = "dragonfly", target_os = "espidf", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] // not implemented in libc for NetBSD yet diff --git a/src/io/dup.rs b/src/io/dup.rs index 1d1a4852d..d5eb6f54b 100644 --- a/src/io/dup.rs +++ b/src/io/dup.rs @@ -115,7 +115,7 @@ pub fn dup2(fd: Fd, new: &mut OwnedFd) -> io::Result<()> { target_os = "aix", target_os = "espidf", target_os = "horizon", - target_os = "nto", + nto, target_os = "vita", target_os = "wasi" )))] diff --git a/src/io/read_write.rs b/src/io/read_write.rs index a2c13a9ac..b4c303061 100644 --- a/src/io/read_write.rs +++ b/src/io/read_write.rs @@ -218,7 +218,7 @@ pub fn writev(fd: Fd, bufs: &[IoSlice<'_>]) -> io::Result { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "solaris", target_os = "vita", )))] @@ -256,7 +256,7 @@ pub fn preadv(fd: Fd, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io: target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "solaris", target_os = "vita", )))] diff --git a/src/ioctl/mod.rs b/src/ioctl/mod.rs index 70c690530..6b717ec0e 100644 --- a/src/ioctl/mod.rs +++ b/src/ioctl/mod.rs @@ -331,7 +331,7 @@ type _Opcode = c::c_ulong; target_os = "cygwin", target_os = "fuchsia", target_os = "emscripten", - target_os = "nto", + nto, target_os = "wasi", ))] type _Opcode = c::c_int; diff --git a/src/net/sockopt.rs b/src/net/sockopt.rs index 8faef756d..661b70114 100644 --- a/src/net/sockopt.rs +++ b/src/net/sockopt.rs @@ -158,7 +158,7 @@ use crate::net::xdp::{XdpMmapOffsets, XdpOptionsFlags, XdpStatistics, XdpUmemReg target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "vita", )))] use crate::net::AddressFamily; @@ -580,7 +580,7 @@ pub fn socket_send_buffer_size(fd: Fd) -> io::Result { target_os = "horizon", target_os = "hurd", target_os = "netbsd", - target_os = "nto", + nto, target_os = "vita", )))] #[inline] @@ -1211,7 +1211,7 @@ pub fn set_ipv6_drop_membership( target_os = "aix", target_os = "fuchsia", target_os = "haiku", - target_os = "nto", + nto, target_env = "newlib" ))] #[inline] @@ -1231,7 +1231,7 @@ pub fn set_ip_tos(fd: Fd, value: u8) -> io::Result<()> { target_os = "aix", target_os = "fuchsia", target_os = "haiku", - target_os = "nto", + nto, target_env = "newlib" ))] #[inline] @@ -1281,13 +1281,7 @@ pub fn ip_recvtos(fd: Fd) -> io::Result { /// See the [module-level documentation] for more. /// /// [module-level documentation]: self#references-for-get_ipv6_-and-set_ipv6_-functions -#[cfg(any( - bsd, - linux_like, - target_os = "aix", - target_os = "fuchsia", - target_os = "nto" -))] +#[cfg(any(bsd, linux_like, target_os = "aix", target_os = "fuchsia", nto))] #[inline] #[doc(alias = "IPV6_RECVTCLASS")] pub fn set_ipv6_recvtclass(fd: Fd, value: bool) -> io::Result<()> { @@ -1299,13 +1293,7 @@ pub fn set_ipv6_recvtclass(fd: Fd, value: bool) -> io::Result<()> { /// See the [module-level documentation] for more. /// /// [module-level documentation]: self#references-for-get_ipv6_-and-set_ipv6_-functions -#[cfg(any( - bsd, - linux_like, - target_os = "aix", - target_os = "fuchsia", - target_os = "nto" -))] +#[cfg(any(bsd, linux_like, target_os = "aix", target_os = "fuchsia", nto))] #[inline] #[doc(alias = "IPV6_RECVTCLASS")] pub fn ipv6_recvtclass(fd: Fd) -> io::Result { @@ -1457,12 +1445,7 @@ pub fn tcp_nodelay(fd: Fd) -> io::Result { /// See the [module-level documentation] for more. /// /// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions -#[cfg(not(any( - target_os = "haiku", - target_os = "nto", - target_os = "openbsd", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd", target_os = "redox")))] #[inline] #[doc(alias = "TCP_KEEPCNT")] pub fn set_tcp_keepcnt(fd: Fd, value: u32) -> io::Result<()> { @@ -1474,12 +1457,7 @@ pub fn set_tcp_keepcnt(fd: Fd, value: u32) -> io::Result<()> { /// See the [module-level documentation] for more. /// /// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions -#[cfg(not(any( - target_os = "haiku", - target_os = "nto", - target_os = "openbsd", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd", target_os = "redox")))] #[inline] #[doc(alias = "TCP_KEEPCNT")] pub fn tcp_keepcnt(fd: Fd) -> io::Result { @@ -1493,7 +1471,7 @@ pub fn tcp_keepcnt(fd: Fd) -> io::Result { /// See the [module-level documentation] for more. /// /// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions -#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd")))] #[inline] #[doc(alias = "TCP_KEEPIDLE")] pub fn set_tcp_keepidle(fd: Fd, value: Duration) -> io::Result<()> { @@ -1507,7 +1485,7 @@ pub fn set_tcp_keepidle(fd: Fd, value: Duration) -> io::Result<()> { /// See the [module-level documentation] for more. /// /// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions -#[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd")))] #[inline] #[doc(alias = "TCP_KEEPIDLE")] pub fn tcp_keepidle(fd: Fd) -> io::Result { @@ -1519,12 +1497,7 @@ pub fn tcp_keepidle(fd: Fd) -> io::Result { /// See the [module-level documentation] for more. /// /// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions -#[cfg(not(any( - target_os = "haiku", - target_os = "nto", - target_os = "openbsd", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd", target_os = "redox")))] #[inline] #[doc(alias = "TCP_KEEPINTVL")] pub fn set_tcp_keepintvl(fd: Fd, value: Duration) -> io::Result<()> { @@ -1536,12 +1509,7 @@ pub fn set_tcp_keepintvl(fd: Fd, value: Duration) -> io::Result<()> { /// See the [module-level documentation] for more. /// /// [module-level documentation]: self#references-for-get_tcp_-and-set_tcp_-functions -#[cfg(not(any( - target_os = "haiku", - target_os = "nto", - target_os = "openbsd", - target_os = "redox" -)))] +#[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd", target_os = "redox")))] #[inline] #[doc(alias = "TCP_KEEPINTVL")] pub fn tcp_keepintvl(fd: Fd) -> io::Result { diff --git a/src/net/types.rs b/src/net/types.rs index 8eca89ca0..e80956364 100644 --- a/src/net/types.rs +++ b/src/net/types.rs @@ -100,7 +100,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -119,7 +119,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -153,7 +153,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -169,7 +169,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -185,7 +185,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -200,7 +200,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -216,7 +216,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -241,7 +241,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -257,7 +257,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -272,7 +272,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -292,7 +292,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -308,7 +308,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -324,7 +324,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -340,7 +340,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -356,7 +356,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -380,7 +380,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -396,7 +396,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -412,7 +412,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -428,7 +428,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -444,7 +444,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -460,7 +460,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -490,7 +490,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -506,7 +506,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -536,7 +536,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -552,7 +552,7 @@ impl AddressFamily { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -563,7 +563,7 @@ impl AddressFamily { #[cfg(target_os = "fuchsia")] /// `AF_ALG` pub const ALG: Self = Self(c::AF_ALG as _); - #[cfg(any(target_os = "freebsd", target_os = "netbsd", target_os = "nto"))] + #[cfg(any(target_os = "freebsd", target_os = "netbsd", nto))] /// `AF_ARP` pub const ARP: Self = Self(c::AF_ARP as _); /// `AF_ATM` @@ -573,19 +573,19 @@ impl AddressFamily { #[cfg(any(target_os = "android", target_os = "emscripten", target_os = "fuchsia"))] pub const CAIF: Self = Self(c::AF_CAIF as _); /// `AF_CCITT` - #[cfg(any(bsd, solarish, target_os = "aix", target_os = "nto"))] + #[cfg(any(bsd, solarish, target_os = "aix", nto))] pub const CCITT: Self = Self(c::AF_CCITT as _); /// `AF_CHAOS` - #[cfg(any(bsd, solarish, target_os = "aix", target_os = "nto"))] + #[cfg(any(bsd, solarish, target_os = "aix", nto))] pub const CHAOS: Self = Self(c::AF_CHAOS as _); /// `AF_CNT` - #[cfg(any(bsd, target_os = "nto"))] + #[cfg(any(bsd, nto))] pub const CNT: Self = Self(c::AF_CNT as _); /// `AF_COIP` - #[cfg(any(bsd, target_os = "nto"))] + #[cfg(any(bsd, nto))] pub const COIP: Self = Self(c::AF_COIP as _); /// `AF_DATAKIT` - #[cfg(any(bsd, solarish, target_os = "aix", target_os = "nto"))] + #[cfg(any(bsd, solarish, target_os = "aix", nto))] pub const DATAKIT: Self = Self(c::AF_DATAKIT as _); /// `AF_DLI` #[cfg(any( @@ -593,11 +593,11 @@ impl AddressFamily { solarish, target_os = "aix", target_os = "haiku", - target_os = "nto" + nto ))] pub const DLI: Self = Self(c::AF_DLI as _); /// `AF_E164` - #[cfg(any(bsd, target_os = "nto"))] + #[cfg(any(bsd, nto))] pub const E164: Self = Self(c::AF_E164 as _); /// `AF_ECMA` #[cfg(any( @@ -605,7 +605,7 @@ impl AddressFamily { freebsdlike, solarish, target_os = "aix", - target_os = "nto", + nto, target_os = "openbsd" ))] pub const ECMA: Self = Self(c::AF_ECMA as _); @@ -619,13 +619,13 @@ impl AddressFamily { #[cfg(solarish)] pub const GOSIP: Self = Self(c::AF_GOSIP as _); /// `AF_HYLINK` - #[cfg(any(bsd, solarish, target_os = "aix", target_os = "nto"))] + #[cfg(any(bsd, solarish, target_os = "aix", nto))] pub const HYLINK: Self = Self(c::AF_HYLINK as _); /// `AF_IB` #[cfg(any(target_os = "emscripten", target_os = "fuchsia"))] pub const IB: Self = Self(c::AF_IB as _); /// `AF_IMPLINK` - #[cfg(any(bsd, solarish, target_os = "aix", target_os = "nto"))] + #[cfg(any(bsd, solarish, target_os = "aix", nto))] pub const IMPLINK: Self = Self(c::AF_IMPLINK as _); /// `AF_IEEE80211` #[cfg(any(apple, freebsdlike, target_os = "netbsd"))] @@ -643,10 +643,10 @@ impl AddressFamily { #[cfg(target_os = "aix")] pub const INTF: Self = Self(c::AF_INTF as _); /// `AF_ISO` - #[cfg(any(bsd, target_os = "aix", target_os = "nto"))] + #[cfg(any(bsd, target_os = "aix", nto))] pub const ISO: Self = Self(c::AF_ISO as _); /// `AF_LAT` - #[cfg(any(bsd, solarish, target_os = "aix", target_os = "nto"))] + #[cfg(any(bsd, solarish, target_os = "aix", nto))] pub const LAT: Self = Self(c::AF_LAT as _); /// `AF_LINK` #[cfg(any( @@ -654,7 +654,7 @@ impl AddressFamily { solarish, target_os = "aix", target_os = "haiku", - target_os = "nto" + nto ))] pub const LINK: Self = Self(c::AF_LINK as _); /// `AF_MPLS` @@ -666,7 +666,7 @@ impl AddressFamily { ))] pub const MPLS: Self = Self(c::AF_MPLS as _); /// `AF_NATM` - #[cfg(any(bsd, target_os = "nto"))] + #[cfg(any(bsd, nto))] pub const NATM: Self = Self(c::AF_NATM as _); /// `AF_NBS` #[cfg(solarish)] @@ -696,13 +696,20 @@ impl AddressFamily { #[cfg(any(target_os = "emscripten", target_os = "fuchsia"))] pub const NFC: Self = Self(c::AF_NFC as _); /// `AF_NS` - #[cfg(any(apple, solarish, netbsdlike, target_os = "aix", target_os = "nto"))] + #[cfg(any( + apple, + solarish, + netbsdlike, + target_os = "aix", + // io-pkt, the QNX 7 network stack; io-sock (QNX 7.1 iosock, QNX 8) has no `AF_NS` + all(target_os = "nto", any(target_env = "nto70", target_env = "nto71")) + ))] pub const NS: Self = Self(c::AF_NS as _); /// `AF_OROUTE` #[cfg(target_os = "netbsd")] pub const OROUTE: Self = Self(c::AF_OROUTE as _); /// `AF_OSI` - #[cfg(any(bsd, solarish, target_os = "aix", target_os = "nto"))] + #[cfg(any(bsd, solarish, target_os = "aix", nto))] pub const OSI: Self = Self(c::AF_OSI as _); /// `AF_OSINET` #[cfg(solarish)] @@ -714,7 +721,7 @@ impl AddressFamily { #[cfg(apple)] pub const PPP: Self = Self(c::AF_PPP as _); /// `AF_PUP` - #[cfg(any(bsd, solarish, target_os = "aix", target_os = "nto"))] + #[cfg(any(bsd, solarish, target_os = "aix", nto))] pub const PUP: Self = Self(c::AF_PUP as _); /// `AF_RIF` #[cfg(target_os = "aix")] @@ -727,7 +734,7 @@ impl AddressFamily { target_os = "emscripten", target_os = "fuchsia", target_os = "haiku", - target_os = "nto" + nto ))] pub const ROUTE: Self = Self(c::AF_ROUTE as _); /// `AF_SCLUSTER` @@ -883,7 +890,7 @@ pub mod ipproto { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "openbsd", target_os = "redox", target_os = "vita", @@ -945,7 +952,7 @@ pub mod ipproto { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -960,7 +967,7 @@ pub mod ipproto { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -1000,7 +1007,7 @@ pub mod ipproto { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -1030,7 +1037,7 @@ pub mod ipproto { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -1047,7 +1054,7 @@ pub mod ipproto { target_os = "haiku", target_os = "horizon", target_os = "netbsd", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -1070,7 +1077,7 @@ pub mod ipproto { target_os = "fuchsia", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -1098,7 +1105,7 @@ pub mod ipproto { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] @@ -1706,7 +1713,7 @@ bitflags! { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto", + nto, target_os = "vita", )))] const NONBLOCK = bitcast!(c::SOCK_NONBLOCK); diff --git a/src/pipe.rs b/src/pipe.rs index ef1c25c68..2bdbe9d5c 100644 --- a/src/pipe.rs +++ b/src/pipe.rs @@ -104,7 +104,7 @@ pub fn pipe() -> io::Result<(OwnedFd, OwnedFd)> { target_os = "espidf", target_os = "haiku", target_os = "horizon", - target_os = "nto" + nto )))] #[inline] #[doc(alias = "pipe2")] diff --git a/src/signal.rs b/src/signal.rs index e69c64b83..abb2f3d45 100644 --- a/src/signal.rs +++ b/src/signal.rs @@ -94,7 +94,7 @@ impl Signal { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita", all( linux_kernel, @@ -315,7 +315,7 @@ impl Signal { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita", all( linux_kernel, @@ -423,7 +423,7 @@ impl fmt::Debug for Signal { target_os = "haiku", target_os = "horizon", target_os = "hurd", - target_os = "nto", + nto, target_os = "vita", all( linux_kernel, diff --git a/src/termios/types.rs b/src/termios/types.rs index cadbc4767..305c040d3 100644 --- a/src/termios/types.rs +++ b/src/termios/types.rs @@ -1,8 +1,8 @@ use crate::backend::c; use crate::backend::termios::types; -#[cfg(target_os = "nto")] +#[cfg(nto)] use crate::ffi; -#[cfg(target_os = "nto")] +#[cfg(nto)] use crate::types::Padding; use crate::{backend, io}; use bitflags::bitflags; @@ -47,7 +47,7 @@ pub struct Termios { #[cfg(not(target_os = "haiku"))] pub special_codes: SpecialCodes, - #[cfg(target_os = "nto")] + #[cfg(nto)] pub(crate) __reserved: Padding<[ffi::c_uint; 3]>, /// Line discipline. @@ -81,7 +81,7 @@ impl Termios { /// /// In raw mode, input is available a byte at a time, echoing is disabled, /// and special terminal input and output codes are disabled. - #[cfg(not(target_os = "nto"))] + #[cfg(not(nto))] #[doc(alias = "cfmakeraw")] #[inline] pub fn make_raw(&mut self) { @@ -164,7 +164,7 @@ impl Termios { /// encoded constant value. Not all implementations support all integer /// values; use the constants in the [`speed`] module for likely-supported /// speeds. - #[cfg(not(target_os = "nto"))] + #[cfg(not(nto))] #[doc(alias = "cfsetspeed")] #[doc(alias = "CBAUD")] #[doc(alias = "CBAUDEX")] @@ -277,7 +277,7 @@ bitflags! { const ICRNL = c::ICRNL; /// `IUCLC` - #[cfg(any(linux_raw_dep, solarish, target_os = "aix", target_os = "haiku", target_os = "nto"))] + #[cfg(any(linux_raw_dep, solarish, target_os = "aix", target_os = "haiku", nto))] const IUCLC = c::IUCLC; /// `IXON` @@ -647,7 +647,7 @@ bitflags! { const CLOCAL = c::CLOCAL; /// `CRTSCTS` - #[cfg(not(any(target_os = "aix", target_os = "nto", target_os = "redox")))] + #[cfg(not(any(target_os = "aix", nto, target_os = "redox")))] const CRTSCTS = c::CRTSCTS; /// `CMSPAR` @@ -658,7 +658,7 @@ bitflags! { target_os = "emscripten", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, target_os = "redox", )))] const CMSPAR = c::CMSPAR; @@ -682,7 +682,7 @@ bitflags! { const ECHOCTL = c::ECHOCTL; /// `ECHOPRT` - #[cfg(not(any(target_os = "cygwin", target_os = "nto", target_os = "redox")))] + #[cfg(not(any(target_os = "cygwin", nto, target_os = "redox")))] const ECHOPRT = c::ECHOPRT; /// `ECHOKE` @@ -690,11 +690,11 @@ bitflags! { const ECHOKE = c::ECHOKE; /// `FLUSHO` - #[cfg(not(any(target_os = "nto", target_os = "redox")))] + #[cfg(not(any(nto, target_os = "redox")))] const FLUSHO = c::FLUSHO; /// `PENDIN` - #[cfg(not(any(target_os = "cygwin", target_os = "nto", target_os = "redox")))] + #[cfg(not(any(target_os = "cygwin", nto, target_os = "redox")))] const PENDIN = c::PENDIN; /// `EXTPROC` @@ -702,7 +702,7 @@ bitflags! { target_os = "aix", target_os = "cygwin", target_os = "haiku", - target_os = "nto", + nto, target_os = "redox", )))] const EXTPROC = c::EXTPROC; @@ -928,37 +928,25 @@ pub mod speed { c::B57600 => Some(57600), #[cfg(not(target_os = "aix"))] c::B115200 => Some(115_200), - #[cfg(not(any(target_os = "aix", target_os = "nto")))] + #[cfg(not(any(target_os = "aix", nto)))] c::B230400 => Some(230_400), #[cfg(not(any( apple, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "openbsd" )))] c::B460800 => Some(460_800), - #[cfg(not(any( - bsd, - solarish, - target_os = "aix", - target_os = "haiku", - target_os = "nto" - )))] + #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku", nto)))] c::B500000 => Some(500_000), - #[cfg(not(any( - bsd, - solarish, - target_os = "aix", - target_os = "haiku", - target_os = "nto" - )))] + #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku", nto)))] c::B576000 => Some(576_000), #[cfg(not(any( apple, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "openbsd" )))] c::B921600 => Some(921_600), @@ -966,7 +954,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris" )))] c::B1000000 => Some(1_000_000), @@ -974,7 +962,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris" )))] c::B1152000 => Some(1_152_000), @@ -982,7 +970,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris" )))] c::B1500000 => Some(1_500_000), @@ -990,7 +978,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris" )))] c::B2000000 => Some(2_000_000), @@ -1000,7 +988,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris", )))] c::B2500000 => Some(2_500_000), @@ -1010,7 +998,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris", )))] c::B3000000 => Some(3_000_000), @@ -1021,7 +1009,7 @@ pub mod speed { target_os = "aix", target_os = "cygwin", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris", )))] c::B3500000 => Some(3_500_000), @@ -1032,7 +1020,7 @@ pub mod speed { target_os = "aix", target_os = "cygwin", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris", )))] c::B4000000 => Some(4_000_000), @@ -1065,37 +1053,25 @@ pub mod speed { 57600 => Some(c::B57600), #[cfg(not(target_os = "aix"))] 115_200 => Some(c::B115200), - #[cfg(not(any(target_os = "aix", target_os = "nto")))] + #[cfg(not(any(target_os = "aix", nto)))] 230_400 => Some(c::B230400), #[cfg(not(any( apple, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "openbsd", )))] 460_800 => Some(c::B460800), - #[cfg(not(any( - bsd, - solarish, - target_os = "aix", - target_os = "haiku", - target_os = "nto" - )))] + #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku", nto)))] 500_000 => Some(c::B500000), - #[cfg(not(any( - bsd, - solarish, - target_os = "aix", - target_os = "haiku", - target_os = "nto" - )))] + #[cfg(not(any(bsd, solarish, target_os = "aix", target_os = "haiku", nto)))] 576_000 => Some(c::B576000), #[cfg(not(any( apple, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "openbsd" )))] 921_600 => Some(c::B921600), @@ -1103,7 +1079,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris" )))] 1_000_000 => Some(c::B1000000), @@ -1111,7 +1087,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris" )))] 1_152_000 => Some(c::B1152000), @@ -1119,7 +1095,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris" )))] 1_500_000 => Some(c::B1500000), @@ -1127,7 +1103,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris" )))] 2_000_000 => Some(c::B2000000), @@ -1137,7 +1113,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris", )))] 2_500_000 => Some(c::B2500000), @@ -1147,7 +1123,7 @@ pub mod speed { bsd, target_os = "aix", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris", )))] 3_000_000 => Some(c::B3000000), @@ -1158,7 +1134,7 @@ pub mod speed { target_os = "aix", target_os = "cygwin", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris", )))] 3_500_000 => Some(c::B3500000), @@ -1169,7 +1145,7 @@ pub mod speed { target_os = "aix", target_os = "cygwin", target_os = "haiku", - target_os = "nto", + nto, target_os = "solaris", )))] 4_000_000 => Some(c::B4000000), @@ -1273,7 +1249,7 @@ impl SpecialCodeIndex { target_os = "aix", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, )))] pub const VSWTC: Self = Self(c::VSWTC as usize); @@ -1309,7 +1285,7 @@ impl SpecialCodeIndex { pub const VEOL2: Self = Self(c::VEOL2 as usize); /// `VSWTCH` - #[cfg(any(solarish, target_os = "haiku", target_os = "nto"))] + #[cfg(any(solarish, target_os = "haiku", nto))] pub const VSWTCH: Self = Self(c::VSWTCH as usize); /// `VDSUSP` @@ -1318,7 +1294,7 @@ impl SpecialCodeIndex { solarish, target_os = "aix", target_os = "hurd", - target_os = "nto" + nto ))] pub const VDSUSP: Self = Self(c::VDSUSP as usize); @@ -1383,7 +1359,7 @@ impl core::fmt::Debug for SpecialCodeIndex { target_os = "aix", target_os = "haiku", target_os = "hurd", - target_os = "nto", + nto, )))] Self::VSWTC => write!(f, "VSWTC"), Self::VSTART => write!(f, "VSTART"), @@ -1405,15 +1381,9 @@ impl core::fmt::Debug for SpecialCodeIndex { #[cfg(not(target_os = "haiku"))] Self::VLNEXT => write!(f, "VLNEXT"), Self::VEOL2 => write!(f, "VEOL2"), - #[cfg(any(solarish, target_os = "haiku", target_os = "nto"))] + #[cfg(any(solarish, target_os = "haiku", nto))] Self::VSWTCH => write!(f, "VSWTCH"), - #[cfg(any( - bsd, - solarish, - target_os = "aix", - target_os = "hurd", - target_os = "nto" - ))] + #[cfg(any(bsd, solarish, target_os = "aix", target_os = "hurd", nto))] Self::VDSUSP => write!(f, "VDSUSP"), #[cfg(any(bsd, target_os = "hurd", target_os = "illumos"))] Self::VSTATUS => write!(f, "VSTATUS"), diff --git a/tests/fs/invalid_offset.rs b/tests/fs/invalid_offset.rs index 8e16ba623..c673b7ac4 100644 --- a/tests/fs/invalid_offset.rs +++ b/tests/fs/invalid_offset.rs @@ -32,12 +32,7 @@ fn invalid_offset_seek() { seek(&file, SeekFrom::Current(i64::MIN)).unwrap_err(); } -#[cfg(not(any( - netbsdlike, - target_os = "dragonfly", - target_os = "nto", - target_os = "redox" -)))] +#[cfg(not(any(netbsdlike, target_os = "dragonfly", nto, target_os = "redox")))] #[test] fn invalid_offset_fallocate() { use rustix::fs::{fallocate, openat, FallocateFlags, Mode, OFlags, CWD}; diff --git a/tests/fs/main.rs b/tests/fs/main.rs index a0bfc3343..18ad30c69 100644 --- a/tests/fs/main.rs +++ b/tests/fs/main.rs @@ -12,7 +12,7 @@ mod dir; target_os = "dragonfly", target_os = "espidf", target_os = "horizon", - target_os = "nto", + nto, target_os = "redox", target_os = "vita", )))] // not implemented in libc for NetBSD yet diff --git a/tests/net/sockopt.rs b/tests/net/sockopt.rs index d79c93307..47db4627d 100644 --- a/tests/net/sockopt.rs +++ b/tests/net/sockopt.rs @@ -194,17 +194,12 @@ fn test_sockopts_tcp(s: &OwnedFd) { assert!(!sockopt::tcp_nodelay(s).unwrap()); - #[cfg(not(any( - target_os = "haiku", - target_os = "nto", - target_os = "openbsd", - target_os = "redox" - )))] + #[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd", target_os = "redox")))] { assert!(sockopt::tcp_keepcnt(s).is_ok()); assert!(sockopt::tcp_keepintvl(s).is_ok()); } - #[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))] + #[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd")))] { assert!(sockopt::tcp_keepidle(s).is_ok()); } @@ -221,7 +216,7 @@ fn test_sockopts_tcp(s: &OwnedFd) { // Check that the nodelay flag is cleared. assert!(!sockopt::tcp_nodelay(s).unwrap()); - #[cfg(not(any(target_os = "haiku", target_os = "nto", target_os = "openbsd")))] + #[cfg(not(any(target_os = "haiku", nto, target_os = "openbsd")))] { #[cfg(not(target_os = "redox"))] { @@ -314,7 +309,7 @@ fn test_sockopts_ipv4() { target_os = "espidf", target_os = "haiku", target_os = "netbsd", - target_os = "nto", + nto, )))] assert_eq!(sockopt::socket_domain(&s).unwrap(), AddressFamily::INET); assert_ne!(sockopt::ip_ttl(&s).unwrap(), 0); @@ -346,13 +341,13 @@ fn test_sockopts_ipv4() { target_os = "aix", target_os = "fuchsia", target_os = "haiku", - target_os = "nto", + nto, target_env = "newlib" ))] { assert_eq!(sockopt::ip_tos(&s).unwrap(), 0); - #[cfg(any(linux_like, target_os = "aix", target_os = "nto"))] + #[cfg(any(linux_like, target_os = "aix", nto))] { sockopt::set_ip_tos(&s, libc::IPTOS_THROUGHPUT).unwrap(); assert_eq!(sockopt::ip_tos(&s).unwrap(), libc::IPTOS_THROUGHPUT); @@ -411,7 +406,7 @@ fn test_sockopts_ipv6() { target_os = "espidf", target_os = "haiku", target_os = "netbsd", - target_os = "nto", + nto, )))] assert_eq!(sockopt::socket_domain(&s).unwrap(), AddressFamily::INET6); @@ -488,13 +483,7 @@ fn test_sockopts_ipv6() { assert_eq!(sockopt::ipv6_unicast_hops(&s).unwrap(), 8); // Check the initial value of `IPV6_RECVTCLASS`, set it, and check it. - #[cfg(any( - bsd, - linux_like, - target_os = "aix", - target_os = "fuchsia", - target_os = "nto" - ))] + #[cfg(any(bsd, linux_like, target_os = "aix", target_os = "fuchsia", nto))] { assert!(!sockopt::ipv6_recvtclass(&s).unwrap()); sockopt::set_ipv6_recvtclass(&s, true).unwrap();