From d1b2d29528b7794b41e66fc2136e395a02f8529b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:59:35 +0200 Subject: Merging upstream version 1.73.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/rustix/src/backend/libc/net/addr.rs | 16 +++--- vendor/rustix/src/backend/libc/net/ext.rs | 4 +- vendor/rustix/src/backend/libc/net/mod.rs | 2 +- .../rustix/src/backend/libc/net/read_sockaddr.rs | 6 +- vendor/rustix/src/backend/libc/net/send_recv.rs | 7 ++- vendor/rustix/src/backend/libc/net/syscalls.rs | 64 ++++++++++++++++++---- .../rustix/src/backend/libc/net/write_sockaddr.rs | 6 +- 7 files changed, 75 insertions(+), 30 deletions(-) (limited to 'vendor/rustix/src/backend/libc/net') diff --git a/vendor/rustix/src/backend/libc/net/addr.rs b/vendor/rustix/src/backend/libc/net/addr.rs index bf7d239de..bd2e7dafe 100644 --- a/vendor/rustix/src/backend/libc/net/addr.rs +++ b/vendor/rustix/src/backend/libc/net/addr.rs @@ -76,12 +76,12 @@ impl SocketAddrUnix { fn init() -> c::sockaddr_un { c::sockaddr_un { - #[cfg(any(bsd, target_os = "haiku"))] + #[cfg(any(bsd, target_os = "haiku", target_os = "nto"))] sun_len: 0, sun_family: c::AF_UNIX as _, - #[cfg(bsd)] + #[cfg(any(bsd, target_os = "nto"))] sun_path: [0; 104], - #[cfg(not(any(bsd, target_os = "haiku")))] + #[cfg(not(any(bsd, target_os = "haiku", target_os = "nto")))] sun_path: [0; 108], #[cfg(target_os = "haiku")] sun_path: [0; 126], @@ -208,15 +208,15 @@ pub type SocketAddrStorage = c::sockaddr_storage; #[inline] pub(crate) fn offsetof_sun_path() -> usize { let z = c::sockaddr_un { - #[cfg(any(bsd, target_os = "haiku"))] + #[cfg(any(bsd, target_os = "haiku", target_os = "nto"))] sun_len: 0_u8, - #[cfg(any(bsd, target_os = "haiku"))] + #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] sun_family: 0_u8, - #[cfg(not(any(bsd, target_os = "haiku")))] + #[cfg(not(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto")))] sun_family: 0_u16, - #[cfg(bsd)] + #[cfg(any(bsd, target_os = "nto"))] sun_path: [0; 104], - #[cfg(not(any(bsd, target_os = "haiku")))] + #[cfg(not(any(bsd, target_os = "haiku", target_os = "nto")))] sun_path: [0; 108], #[cfg(target_os = "haiku")] sun_path: [0; 126], diff --git a/vendor/rustix/src/backend/libc/net/ext.rs b/vendor/rustix/src/backend/libc/net/ext.rs index 4b2d10756..50bd89db6 100644 --- a/vendor/rustix/src/backend/libc/net/ext.rs +++ b/vendor/rustix/src/backend/libc/net/ext.rs @@ -78,7 +78,7 @@ pub(crate) const fn sockaddr_in6_sin6_scope_id(addr: &c::sockaddr_in6) -> u32 { #[cfg(not(windows))] #[inline] pub(crate) const fn sockaddr_in6_new( - #[cfg(any(bsd, target_os = "haiku"))] sin6_len: u8, + #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] sin6_len: u8, sin6_family: c::sa_family_t, sin6_port: u16, sin6_flowinfo: u32, @@ -86,7 +86,7 @@ pub(crate) const fn sockaddr_in6_new( sin6_scope_id: u32, ) -> c::sockaddr_in6 { c::sockaddr_in6 { - #[cfg(any(bsd, target_os = "haiku"))] + #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] sin6_len, sin6_family, sin6_port, diff --git a/vendor/rustix/src/backend/libc/net/mod.rs b/vendor/rustix/src/backend/libc/net/mod.rs index 1b68f1b26..65c7d0654 100644 --- a/vendor/rustix/src/backend/libc/net/mod.rs +++ b/vendor/rustix/src/backend/libc/net/mod.rs @@ -1,6 +1,6 @@ pub(crate) mod addr; pub(crate) mod ext; -#[cfg(not(any(target_os = "redox", target_os = "wasi", windows)))] +#[cfg(not(any(windows, target_os = "espidf", target_os = "redox", target_os = "wasi")))] pub(crate) mod msghdr; pub(crate) mod read_sockaddr; pub(crate) mod send_recv; diff --git a/vendor/rustix/src/backend/libc/net/read_sockaddr.rs b/vendor/rustix/src/backend/libc/net/read_sockaddr.rs index c3b23e8c2..cde851af6 100644 --- a/vendor/rustix/src/backend/libc/net/read_sockaddr.rs +++ b/vendor/rustix/src/backend/libc/net/read_sockaddr.rs @@ -26,11 +26,11 @@ struct sockaddr_header { unsafe fn read_ss_family(storage: *const c::sockaddr_storage) -> u16 { // Assert that we know the layout of `sockaddr`. let _ = c::sockaddr { - #[cfg(any(bsd, target_os = "haiku"))] + #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] sa_len: 0_u8, - #[cfg(any(bsd, target_os = "haiku"))] + #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] sa_family: 0_u8, - #[cfg(not(any(bsd, target_os = "haiku")))] + #[cfg(not(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto")))] sa_family: 0_u16, #[cfg(not(target_os = "haiku"))] sa_data: [0; 14], diff --git a/vendor/rustix/src/backend/libc/net/send_recv.rs b/vendor/rustix/src/backend/libc/net/send_recv.rs index e91017e97..26543a1fd 100644 --- a/vendor/rustix/src/backend/libc/net/send_recv.rs +++ b/vendor/rustix/src/backend/libc/net/send_recv.rs @@ -14,6 +14,8 @@ bitflags! { bsd, solarish, windows, + target_os = "espidf", + target_os = "nto", target_os = "haiku", )))] const CONFIRM = bitcast!(c::MSG_CONFIRM); @@ -31,6 +33,7 @@ bitflags! { solarish, windows, target_os = "haiku", + target_os = "nto", )))] const MORE = bitcast!(c::MSG_MORE); #[cfg(not(any(apple, windows)))] @@ -49,7 +52,7 @@ bitflags! { #[repr(transparent)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct RecvFlags: u32 { - #[cfg(not(any(apple, solarish, windows, target_os = "haiku")))] + #[cfg(not(any(apple, solarish, windows, target_os = "espidf", target_os = "haiku", target_os = "nto")))] /// `MSG_CMSG_CLOEXEC` const CMSG_CLOEXEC = bitcast!(c::MSG_CMSG_CLOEXEC); /// `MSG_DONTWAIT` @@ -60,7 +63,9 @@ bitflags! { bsd, solarish, windows, + target_os = "espidf", target_os = "haiku", + target_os = "nto", )))] const ERRQUEUE = bitcast!(c::MSG_ERRQUEUE); /// `MSG_OOB` 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 { } } -#[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 { @@ -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 { 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); diff --git a/vendor/rustix/src/backend/libc/net/write_sockaddr.rs b/vendor/rustix/src/backend/libc/net/write_sockaddr.rs index efb5a4e14..46f0ef40a 100644 --- a/vendor/rustix/src/backend/libc/net/write_sockaddr.rs +++ b/vendor/rustix/src/backend/libc/net/write_sockaddr.rs @@ -23,7 +23,7 @@ pub(crate) unsafe fn write_sockaddr( pub(crate) unsafe fn encode_sockaddr_v4(v4: &SocketAddrV4) -> c::sockaddr_in { c::sockaddr_in { - #[cfg(any(bsd, target_os = "haiku"))] + #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] sin_len: size_of::() as _, sin_family: c::AF_INET as _, sin_port: u16::to_be(v4.port()), @@ -42,7 +42,7 @@ unsafe fn write_sockaddr_v4(v4: &SocketAddrV4, storage: *mut SocketAddrStorage) } pub(crate) unsafe fn encode_sockaddr_v6(v6: &SocketAddrV6) -> c::sockaddr_in6 { - #[cfg(any(bsd, target_os = "haiku"))] + #[cfg(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto"))] { sockaddr_in6_new( size_of::() as _, @@ -53,7 +53,7 @@ pub(crate) unsafe fn encode_sockaddr_v6(v6: &SocketAddrV6) -> c::sockaddr_in6 { v6.scope_id(), ) } - #[cfg(not(any(bsd, target_os = "haiku")))] + #[cfg(not(any(bsd, target_os = "espidf", target_os = "haiku", target_os = "nto")))] { sockaddr_in6_new( c::AF_INET6 as _, -- cgit v1.2.3