fix(net): return EOF after receive shutdown on Windows #2185
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2185"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by gunerky on 2026-10-09T11:06:02Z.
What
On Windows, receiving after local
shutdown(SHUT_RD)orshutdown(SHUT_RDWR)reports guestEIOwhen Winsock returnsWSAESHUTDOWN. Handle that receive error as a successful zero-byte receive in libkernelrecv,recvfromandrecvmsg, and their libSceNet counterparts. Guest errno and data/address/control buffer bytes are preserved.recvfromreturns a zero source length when an address is supplied;recvmsgalso clears the control length and returns the accepted input flags, following FreeBSD's EOF path.Related to #1786, whose description explicitly defers the receive case to a separate PR. This change does not alter either shared native error map or the send functions and does not depend on #1786.
The behavior comes from FreeBSD 11.4
soshutdownandsoreceiveandkern_recvit/sys_recvmsg. Winsock documentsWSAESHUTDOWNafter disabling receives. No FreeBSD implementation code was copied. The hardware validation gap and scope limits are recorded in TechnicalDebt.Tested
Windows x64 (10.0.26300), WinLibs MinGW-w64 GCC 15.2.0 UCRT/POSIX/SEH, Python 3.12.14, Release,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON; based70b89989473ba1f6ae13e44e079e67f1f8a44b0.SHUT_RD/SHUT_RDWR, repeated receives andMSG_PEEK. They also check untouched data/guard/address/control bytes, errno, source/control lengths, message flags and receives without an address.SHUT_WRpreserving receives,SHUT_RDpreserving sends, send errors afterSHUT_RDWR, invalid flags/buffers, closed descriptors and would-block errors.libc.prx,libkernel.prxandlibSceNet.prxand runs the same behavioral cases for all six receive functions: passed. The harness and logs are local artifacts, not repository additions.libstarget: passed. Full CTest with the existing CI 120 s global timeout: 515 passed, 0 failed, 1 skipped (516 registered tests). An earlier run with a 30 s global timeout passed 513/514 and timed out onlytls_function_coverageat 30.05 s; its source and registration are unchanged by this patch. This is the existing test addressed separately in #1913. No repository test timeout was increased; all six new groups have a 20 s timeout.guest_video_out_wqhd_detection_no_vulkan.git diff --check: passed.Linux, PS5 hardware and games: not tested. This is specifically the translation of
WSAESHUTDOWN; other host errors and existing behavior for queued data, zero-length stream requests and an already blocked receive are unchanged. These tests do not establish hosted CI timing.Checklist
main; no duplicate receive fix found among open PRsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T14:34:02Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceNet/CMakeLists.txtL11-12docs/dev/TechnicalDebt.mdL351Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:09:48Z.
Closing: no title is shown receiving after its own
shutdown(SHUT_RD)on Windows, and nothing reaches this path on main. Reopen with the title ID and the log line if one hits theEIO.Pull request closed