FreeBSD 11.4's soreceive_generic waits in sbwait (sys/kern/uipc_socket.c,
uipc_sockbuf.c), whose msleep_sbt on so_rcv.sb_timeo returns EWOULDBLOCK
(35) for every socket type when SO_RCVTIMEO expires. On Windows the host
socket is non-blocking and native_transfer enforces the timeout itself,
but it reported WSAETIMEDOUT, which only datagram receives turned into
EAGAIN; a stream receive failed with ETIMEDOUT (60). A receive that
reaches the stored timeout now reports WSAEWOULDBLOCK, so every
receive returns EAGAIN, and a host WSAETIMEDOUT still maps to ETIMEDOUT.
A PS5 (firmware 13.60) allocates with any flag value, zero-fills only for
flag 2 and returns 64-byte aligned blocks. Record the measured behaviour of
sceNetGetIfName, sceNetGetRandom, sceNetGetSystemTime, sceNetMemoryFree and
sceNetUsleep, which already match the console, and keep only their open gaps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sceNet translated only 21 host socket errors and reported every other one
as EIO. libkernel already owns the complete FreeBSD table in
GuestSockets::GuestErrorFromHost, so use it for net_error. The new check
makes a stream socket with the UDP protocol fail with EPROTONOSUPPORT (43)
instead of EIO (5).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Report the host IPv4 DNS servers of the interface sceNetCtlGetInfo
uses, through a helper libSceNetCtl exports, and return their count.
The signature and layout follow the OpenOrbis musl resolver and Net.h.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sceNetGetSockInfo returned 0 for a known socket and wrote nothing, so
callers read uninitialised bytes as the socket's endpoints. Monster
Hunter Wilds (PPSA24191) calls it after bind, connect and accept and
stores the local and remote address and port it reads back.
It now writes one 0xA0-byte record in the layout SharpProspero and
shadPS4 give: the socket id, the socket type, the local and remote
IPv4 address and port of the host socket in network byte order, the
SELF and NONBLOCK status flags, and the receive and send buffer sizes
sceNetGetsockopt reports for the socket. The other fields are 0. It
returns 1, the number of records written, and EINVAL for a null record
or an n below 1, as shadPS4 does.
An s below 0 lists the sockets as shadPS4 does: with a null record it
returns their number, otherwise it writes up to n records in socket
order and returns how many it wrote. Unlike shadPS4, which lists IPv6
sockets with zero addresses and ignores flags, an IPv6 socket fails
with EAFNOSUPPORT and is left out of the count and the list, and a
flags bit other than 0x40 fails with EINVAL. SharpProspero names 0x40
SockInfoTimeWait; closed sockets leave the table at once, so it lists
the same sockets. docs/dev/debt/libSceNet.md lists the fields left 0
and these differences.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>