about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorChris Denton <christophersdenton@gmail.com>2025-04-13 11:48:15 +0000
committerGitHub <noreply@github.com>2025-04-13 11:48:15 +0000
commit9d2d6a040f369ac7afcde38f08a8c74a558879e2 (patch)
treef69c2320cbc1f167c562b276a4ddd9fe14506cb0 /library/std
parent65fa0ab9246da73183b848a0c29b033779fe6f6c (diff)
parent0acac2cbe306b8db9bc0a7c45f529f1dfa6680c8 (diff)
downloadrust-9d2d6a040f369ac7afcde38f08a8c74a558879e2.tar.gz
rust-9d2d6a040f369ac7afcde38f08a8c74a558879e2.zip
Rollup merge of #138972 - thaliaarchi:nuttx-build, r=Mark-Simulacrum
std: Fix build for NuttX targets

Fix std build for all NuttX targets. It is the single largest set of failures on <https://does-it-build.noratrieb.dev/>. Although, ESP-IDF also requires these same gates, there are other issues for those targets.

This can verified be running `x check library/std --target=` for all NuttX targets.

cc ``@no1wudi``
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/sys/fd/unix.rs2
-rw-r--r--library/std/src/sys/net/connection/socket/unix.rs1
2 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/sys/fd/unix.rs b/library/std/src/sys/fd/unix.rs
index 2042ea2c73d..13fefb4031d 100644
--- a/library/std/src/sys/fd/unix.rs
+++ b/library/std/src/sys/fd/unix.rs
@@ -71,9 +71,11 @@ const fn max_iov() -> usize {
     target_os = "android",
     target_os = "dragonfly",
     target_os = "emscripten",
+    target_os = "espidf",
     target_os = "freebsd",
     target_os = "linux",
     target_os = "netbsd",
+    target_os = "nuttx",
     target_os = "nto",
     target_os = "openbsd",
     target_os = "horizon",
diff --git a/library/std/src/sys/net/connection/socket/unix.rs b/library/std/src/sys/net/connection/socket/unix.rs
index bbe1e038dcc..b35d5d2aa84 100644
--- a/library/std/src/sys/net/connection/socket/unix.rs
+++ b/library/std/src/sys/net/connection/socket/unix.rs
@@ -1,5 +1,6 @@
 use libc::{MSG_PEEK, c_int, c_void, size_t, sockaddr, socklen_t};
 
+#[cfg(not(any(target_os = "espidf", target_os = "nuttx")))]
 use crate::ffi::CStr;
 use crate::io::{self, BorrowedBuf, BorrowedCursor, IoSlice, IoSliceMut};
 use crate::net::{Shutdown, SocketAddr};