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
This commit is contained in:
Mads Marquart 2024-05-06 02:30:52 +02:00
parent 9c9b568792
commit c64889c537

View File

@ -81,21 +81,25 @@ impl UnixListener {
))] ))]
const backlog: core::ffi::c_int = 128; const backlog: core::ffi::c_int = 128;
#[cfg(any( #[cfg(any(
// Silently capped to `/proc/sys/net/core/somaxconn`.
target_os = "linux", target_os = "linux",
// Silently capped to `kern.ipc.soacceptqueue`.
target_os = "freebsd", target_os = "freebsd",
// Silently capped to `kern.somaxconn sysctl`.
target_os = "openbsd", target_os = "openbsd",
target_os = "macos" // Silently capped to the default 128.
target_vendor = "apple",
))] ))]
const backlog: core::ffi::c_int = -1; const backlog: core::ffi::c_int = -1;
#[cfg(not(any( #[cfg(not(any(
target_os = "windows", target_os = "windows",
target_os = "redox", target_os = "redox",
target_os = "espidf",
target_os = "horizon",
target_os = "linux", target_os = "linux",
target_os = "freebsd", target_os = "freebsd",
target_os = "openbsd", target_os = "openbsd",
target_os = "macos", target_vendor = "apple",
target_os = "espidf",
target_os = "horizon"
)))] )))]
const backlog: libc::c_int = libc::SOMAXCONN; const backlog: libc::c_int = libc::SOMAXCONN;