net: support Nuttx target os (#8259)

Signed-off-by: wanglei <[email protected]>
This commit is contained in:
wanglei01
2026-07-07 16:01:24 +02:00
committed by GitHub
parent bb2815ae23
commit c4c6265a07
2 changed files with 16 additions and 2 deletions
+4
View File
@@ -286,6 +286,7 @@ impl TcpSocket {
not(target_os = "solaris"), not(target_os = "solaris"),
not(target_os = "illumos"), not(target_os = "illumos"),
not(target_os = "cygwin"), not(target_os = "cygwin"),
not(target_os = "nuttx"),
))] ))]
#[cfg_attr( #[cfg_attr(
docsrs, docsrs,
@@ -294,6 +295,7 @@ impl TcpSocket {
not(target_os = "solaris"), not(target_os = "solaris"),
not(target_os = "illumos"), not(target_os = "illumos"),
not(target_os = "cygwin"), not(target_os = "cygwin"),
not(target_os = "nuttx"),
))) )))
)] )]
pub fn set_reuseport(&self, reuseport: bool) -> io::Result<()> { pub fn set_reuseport(&self, reuseport: bool) -> io::Result<()> {
@@ -331,6 +333,7 @@ impl TcpSocket {
not(target_os = "solaris"), not(target_os = "solaris"),
not(target_os = "illumos"), not(target_os = "illumos"),
not(target_os = "cygwin"), not(target_os = "cygwin"),
not(target_os = "nuttx"),
))] ))]
#[cfg_attr( #[cfg_attr(
docsrs, docsrs,
@@ -339,6 +342,7 @@ impl TcpSocket {
not(target_os = "solaris"), not(target_os = "solaris"),
not(target_os = "illumos"), not(target_os = "illumos"),
not(target_os = "cygwin"), not(target_os = "cygwin"),
not(target_os = "nuttx"),
))) )))
)] )]
pub fn reuseport(&self) -> io::Result<bool> { pub fn reuseport(&self) -> io::Result<bool> {
+12 -2
View File
@@ -67,7 +67,12 @@ pub(crate) use self::impl_solaris::get_peer_cred;
#[cfg(target_os = "aix")] #[cfg(target_os = "aix")]
pub(crate) use self::impl_aix::get_peer_cred; pub(crate) use self::impl_aix::get_peer_cred;
#[cfg(any(target_os = "espidf", target_os = "vita", target_os = "hurd"))] #[cfg(any(
target_os = "espidf",
target_os = "nuttx",
target_os = "vita",
target_os = "hurd"
))]
pub(crate) use self::impl_noproc::get_peer_cred; pub(crate) use self::impl_noproc::get_peer_cred;
#[cfg(any( #[cfg(any(
@@ -390,7 +395,12 @@ pub(crate) mod impl_aix {
} }
} }
#[cfg(any(target_os = "espidf", target_os = "vita", target_os = "hurd"))] #[cfg(any(
target_os = "espidf",
target_os = "nuttx",
target_os = "vita",
target_os = "hurd"
))]
pub(crate) mod impl_noproc { pub(crate) mod impl_noproc {
use crate::net::unix::UnixStream; use crate::net::unix::UnixStream;
use std::io; use std::io;