mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
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:
parent
9c9b568792
commit
c64889c537
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user