std::net: bind update for using backlog as -1 too.

Albeit not documented, macOs also support negative value for the backlog
argument.

ref: 2ff845c2e0/bsd/kern/uipc_socket.c (L1061)
This commit is contained in:
David Carlier 2024-01-13 20:04:47 +00:00
parent 9567c3ee73
commit 89cf17777b

View file

@ -80,7 +80,12 @@ impl UnixListener {
target_os = "horizon"
))]
const backlog: libc::c_int = 128;
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
#[cfg(any(
target_os = "linux",
target_os = "freebsd",
target_os = "openbsd",
target_os = "macos"
))]
const backlog: libc::c_int = -1;
#[cfg(not(any(
target_os = "windows",
@ -88,6 +93,7 @@ impl UnixListener {
target_os = "linux",
target_os = "freebsd",
target_os = "openbsd",
target_os = "macos",
target_os = "espidf",
target_os = "horizon"
)))]