about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2024-04-12 16:41:29 +0100
committerDavid Carlier <devnexen@gmail.com>2024-04-12 16:55:10 +0100
commit1ce559b69096fc1cfd306a80250fddb52168d7f4 (patch)
tree5f6d9ac364ae9437e0815611aea9cf26de2a1749 /library/std/src
parent7bdae134cba57426d3c56b5de737a351762445e1 (diff)
downloadrust-1ce559b69096fc1cfd306a80250fddb52168d7f4.tar.gz
rust-1ce559b69096fc1cfd306a80250fddb52168d7f4.zip
std::net: TcpListener shrinks the backlog argument to 32 for Haiku.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys_common/net.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/sys_common/net.rs b/library/std/src/sys_common/net.rs
index 8c9885974b4..6a268633f72 100644
--- a/library/std/src/sys_common/net.rs
+++ b/library/std/src/sys_common/net.rs
@@ -417,6 +417,10 @@ impl TcpListener {
                 // it allows up to about 37, but other times it doesn't even
                 // accept 32. There may be a global limitation causing this.
                 let backlog = 20;
+            } else if #[cfg(target_os = "haiku")] {
+                // Haiku does not support a queue length > 32
+                // https://github.com/haiku/haiku/blob/979a0bc487864675517fb2fab28f87dc8bf43041/headers/posix/sys/socket.h#L81
+                let backlog = 32;
             } else {
                 // The default for all other platforms
                 let backlog = 128;