Skip to content

Commit 89cf177

Browse files
committed
std::net: bind update for using backlog as -1 too.
Albeit not documented, macOs also support negative value for the backlog argument. ref: https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/kern/uipc_socket.c#L1061
1 parent 9567c3e commit 89cf177

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

library/std/src/os/unix/net/listener.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,20 @@ impl UnixListener {
8080
target_os = "horizon"
8181
))]
8282
const backlog: libc::c_int = 128;
83-
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
83+
#[cfg(any(
84+
target_os = "linux",
85+
target_os = "freebsd",
86+
target_os = "openbsd",
87+
target_os = "macos"
88+
))]
8489
const backlog: libc::c_int = -1;
8590
#[cfg(not(any(
8691
target_os = "windows",
8792
target_os = "redox",
8893
target_os = "linux",
8994
target_os = "freebsd",
9095
target_os = "openbsd",
96+
target_os = "macos",
9197
target_os = "espidf",
9298
target_os = "horizon"
9399
)))]

0 commit comments

Comments
 (0)