Closed Meziu closed 8 months ago
The only references I can find in newlib
look to be for unrelated platforms: https://github.com/search?q=repo%3AdevkitPro%2Fnewlib%20SOMAXCONN&type=code
I did find one comment that the libctru
maintainers consider their socket implementation to be "BSD-flavored": https://github.com/devkitPro/3ds-examples/blob/ee2e047049f6962a1deab26779e66f521302ab02/network/sockets/source/sockets.c#L86
So maybe in general we should piggypack onto cfg
s like BSD?
I don't believe the 3DS supports unix sockets at all, given there is no AF_UNIX
defined in libctru/include/sys/socket.h
, so the actual implementation probably doesn't matter much — we could either define an arbitrary SOMAXCONN = 20
in libc
, or set const backlog: libc::c_int = 128
or something in std upstream, just to get it to compile. Any thoughts?
I don't believe the 3DS supports unix sockets at all, given there is no
AF_UNIX
defined inlibctru/include/sys/socket.h
…
Well then, I’ve looked around and it seems like nobody else uses that constant for “generic” socket implementations (such as async/IO crates or std reimplementations). Since we don’t support UnixSockets
, I guess a PR to the std
would be much quicker.
Fixed as of the latest nightly.
Seems like the latest nightly broke something in the
std::os::unix::net
module, for which now the maximum backlog number forhorizonOS
seems to be set tolibc::SOMAXCONN
, a constant we obviously do not include. This is the referred line.We already had problems in the past that made us set the maximum backlog number to
20
forstd::sys_common::net
(right here), but I guess no action was taken forUnixListener
.To be completely honest, I don't know whether
horizon
supportsUnixListener
fully, but this might be a chance to add a newconst
tolibc
that might be used by external crates. Otherwise, we can simply add a#[cfg(target_os = "horizon")]
and set our own value withinstd
. In the mean time, the CI fails on the latest nightly. :(