diff options
Diffstat (limited to 'vendor/rustix/src/backend/libc/net/syscalls.rs')
-rw-r--r-- | vendor/rustix/src/backend/libc/net/syscalls.rs | 64 |
1 files changed, 52 insertions, 12 deletions
diff --git a/vendor/rustix/src/backend/libc/net/syscalls.rs b/vendor/rustix/src/backend/libc/net/syscalls.rs index 63067ff38..b4550583c 100644 --- a/vendor/rustix/src/backend/libc/net/syscalls.rs +++ b/vendor/rustix/src/backend/libc/net/syscalls.rs @@ -10,7 +10,7 @@ use crate::io; use crate::net::{SocketAddrAny, SocketAddrV4, SocketAddrV6}; use crate::utils::as_ptr; use core::mem::{size_of, MaybeUninit}; -#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))] +#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))] use { super::msghdr::{with_noaddr_msghdr, with_recv_msghdr, with_v4_msghdr, with_v6_msghdr}, crate::io::{IoSlice, IoSliceMut}, @@ -256,7 +256,7 @@ pub(crate) fn accept(sockfd: BorrowedFd<'_>) -> io::Result<OwnedFd> { } } -#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))] +#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))] pub(crate) fn recvmsg( sockfd: BorrowedFd<'_>, iov: &mut [IoSliceMut<'_>], @@ -288,7 +288,7 @@ pub(crate) fn recvmsg( }) } -#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))] +#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))] pub(crate) fn sendmsg( sockfd: BorrowedFd<'_>, iov: &[IoSlice<'_>], @@ -304,7 +304,7 @@ pub(crate) fn sendmsg( }) } -#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))] +#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))] pub(crate) fn sendmsg_v4( sockfd: BorrowedFd<'_>, addr: &SocketAddrV4, @@ -321,7 +321,7 @@ pub(crate) fn sendmsg_v4( }) } -#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))] +#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))] pub(crate) fn sendmsg_v6( sockfd: BorrowedFd<'_>, addr: &SocketAddrV6, @@ -338,7 +338,7 @@ pub(crate) fn sendmsg_v6( }) } -#[cfg(all(unix, not(target_os = "redox")))] +#[cfg(all(unix, not(any(target_os = "espidf", target_os = "redox"))))] pub(crate) fn sendmsg_unix( sockfd: BorrowedFd<'_>, addr: &SocketAddrUnix, @@ -358,8 +358,10 @@ pub(crate) fn sendmsg_unix( #[cfg(not(any( apple, windows, + target_os = "espidf", target_os = "haiku", target_os = "redox", + target_os = "nto", target_os = "wasi", )))] pub(crate) fn accept_with(sockfd: BorrowedFd<'_>, flags: SocketFlags) -> io::Result<OwnedFd> { @@ -394,7 +396,9 @@ pub(crate) fn acceptfrom(sockfd: BorrowedFd<'_>) -> io::Result<(OwnedFd, Option< #[cfg(not(any( apple, windows, + target_os = "espidf", target_os = "haiku", + target_os = "nto", target_os = "redox", target_os = "wasi", )))] @@ -420,14 +424,26 @@ pub(crate) fn acceptfrom_with( /// Darwin lacks `accept4`, but does have `accept`. We define /// `SocketFlags` to have no flags, so we can discard it here. -#[cfg(any(apple, windows, target_os = "haiku"))] +#[cfg(any( + apple, + windows, + target_os = "espidf", + target_os = "haiku", + target_os = "nto" +))] pub(crate) fn accept_with(sockfd: BorrowedFd<'_>, _flags: SocketFlags) -> io::Result<OwnedFd> { accept(sockfd) } /// Darwin lacks `accept4`, but does have `accept`. We define /// `SocketFlags` to have no flags, so we can discard it here. -#[cfg(any(apple, windows, target_os = "haiku"))] +#[cfg(any( + apple, + windows, + target_os = "espidf", + target_os = "haiku", + target_os = "nto" +))] pub(crate) fn acceptfrom_with( sockfd: BorrowedFd<'_>, _flags: SocketFlags, @@ -893,9 +909,21 @@ pub(crate) mod sockopt { multiaddr: &Ipv6Addr, interface: u32, ) -> io::Result<()> { - #[cfg(not(any(bsd, solarish, target_os = "haiku", target_os = "l4re")))] + #[cfg(not(any( + bsd, + solarish, + target_os = "haiku", + target_os = "l4re", + target_os = "nto" + )))] use c::IPV6_ADD_MEMBERSHIP; - #[cfg(any(bsd, solarish, target_os = "haiku", target_os = "l4re"))] + #[cfg(any( + bsd, + solarish, + target_os = "haiku", + target_os = "l4re", + target_os = "nto" + ))] use c::IPV6_JOIN_GROUP as IPV6_ADD_MEMBERSHIP; let mreq = to_ipv6mr(multiaddr, interface); @@ -918,9 +946,21 @@ pub(crate) mod sockopt { multiaddr: &Ipv6Addr, interface: u32, ) -> io::Result<()> { - #[cfg(not(any(bsd, solarish, target_os = "haiku", target_os = "l4re")))] + #[cfg(not(any( + bsd, + solarish, + target_os = "haiku", + target_os = "l4re", + target_os = "nto" + )))] use c::IPV6_DROP_MEMBERSHIP; - #[cfg(any(bsd, solarish, target_os = "haiku", target_os = "l4re"))] + #[cfg(any( + bsd, + solarish, + target_os = "haiku", + target_os = "l4re", + target_os = "nto" + ))] use c::IPV6_LEAVE_GROUP as IPV6_DROP_MEMBERSHIP; let mreq = to_ipv6mr(multiaddr, interface); |