about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMads Marquart <mads@marquart.dk>2024-05-06 02:30:52 +0200
committerMads Marquart <mads@marquart.dk>2024-05-06 04:22:23 +0200
commitc64889c537830e75311c4d6c48e9d243e8c97e23 (patch)
tree1a7242323463b3a2b5dc1d24c138131a574107f5 /library/std/src
parent9c9b568792ef20d8459c745345dd3e79b7c7fa8c (diff)
downloadrust-c64889c537830e75311c4d6c48e9d243e8c97e23.tar.gz
rust-c64889c537830e75311c4d6c48e9d243e8c97e23.zip
iOS/tvOS/watchOS/visionOS: Default to kernel-defined backlog in listen
This behavior is defined in general for the XNU kernel, not just macOS:
https://github.com/apple-oss-distributions/xnu/blob/rel/xnu-10002/bsd/kern/uipc_socket.c
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/os/unix/net/listener.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/library/std/src/os/unix/net/listener.rs b/library/std/src/os/unix/net/listener.rs
index 7e53acbc387..a55199c82fc 100644
--- a/library/std/src/os/unix/net/listener.rs
+++ b/library/std/src/os/unix/net/listener.rs
@@ -81,21 +81,25 @@ impl UnixListener {
             ))]
             const backlog: core::ffi::c_int = 128;
             #[cfg(any(
+                // Silently capped to `/proc/sys/net/core/somaxconn`.
                 target_os = "linux",
+                // Silently capped to `kern.ipc.soacceptqueue`.
                 target_os = "freebsd",
+                // Silently capped to `kern.somaxconn sysctl`.
                 target_os = "openbsd",
-                target_os = "macos"
+                // Silently capped to the default 128.
+                target_vendor = "apple",
             ))]
             const backlog: core::ffi::c_int = -1;
             #[cfg(not(any(
                 target_os = "windows",
                 target_os = "redox",
+                target_os = "espidf",
+                target_os = "horizon",
                 target_os = "linux",
                 target_os = "freebsd",
                 target_os = "openbsd",
-                target_os = "macos",
-                target_os = "espidf",
-                target_os = "horizon"
+                target_vendor = "apple",
             )))]
             const backlog: libc::c_int = libc::SOMAXCONN;