fix(libSceNet): failures also set libkernel's errno #4112
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4112"
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 jdmagic on 2026-10-11T23:29:58Z.
What
libSceNet stored the errno of a failed call only in its own slot (
sceNetErrnoLoc). Titles that use the BSD socket model readerrnoafter a libSceNet call instead; shadPS4 mirrors its net errno into the kernel errno the same way (SetKernelErrnoHook). Failures now set both: libSceNet's slot and libkernel's__error().Sackboy: A Big Adventure (PPSA01289) reads
errnothrough Unreal'sGetLastErrorCodeaftersceNetRecvfrom. It never sawEWOULDBLOCK, soUIpNetDriver::TickDispatchkept receiving and the game thread never left its first networked frame.guest_sce_net: aftersceNetSocketCloseon a closed socket,__error()holdsEBADFas well assceNetErrnoLoc().Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), on main
bca7a29d.guest_sce_net,guest_socket_events,guest_socket_pair,guest_socket_read_write,guest_kernel_errors,guest_filesystem,guest_file_vector: 7/7 passed. The fullctestwas not run on this branch.guest_sce_netcheck fails on main without the change toExport.cpp.TickDispatchreturns once the socket is drained and the game thread moves on. With the other libSceNet fixes (the epoll and close/setsockopt PRs) the title reaches its first-boot gamma screen; getting there also needs changes outside this PR.This PR and the two other libSceNet PRs from this branch set are independent and merge cleanly with each other.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code