fix(libkernel): map host socket errors to guest errno #3592
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3592"
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 MarcZX10 on 2026-10-11T13:55:23Z.
What
Fixes #3573.
NativeError()mapped only a small set of POSIX and Winsock errors; all other host errors became guestEIO. This adds a by-name mapping for host socket errors to the corresponding FreeBSD 11 errno values and uses it for both ordinary socket calls and socket-pair creation. Unknown host errors still becomeEIO, andWSAESHUTDOWNcontinues to becomeEPIPE.This carries Hussein Kadhim's commits
a889c98eandc1519d95, preserving their authorship.GuestSocketErrortests every table entry on Linux and Windows. TechnicalDebt records host differences that remain unverified against the console.Tested
libkernelandguest_socket_error_tests.guest_socket_error,guest_udp,guest_socket_read_write,guest_poll,guest_tcp,guest_socket_pair,guest_dupandguest_socket_events— each passed three consecutive runs.python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpassed.Checklist
main; no other open PR implements the same socket-error mappingNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T15:28:13Z.
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)docs/dev/TechnicalDebt.mdL595docs/dev/TechnicalDebt.mdL595Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-11T18:55:51Z.
Windows run of this head (
a13806581, onmaina11c8f7f7): Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, full build.guest_socket_error,guest_udp,guest_socket_read_write,guest_poll,guest_tcp,guest_socket_pair,guest_dupandguest_socket_eventspass 3/3.guest_socket_errorruns its_WIN32table here, so all theWSAE*→ FreeBSD cases have now been run on Windows.guest_socket_errorchecksGuestErrorFromHostdirectly. Withmain'sUdp.cppit still passes, so no test checks thatNativeError()goes through the table. The other seven pass through it unchanged.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:52:50Z.
Checked the 39 FreeBSD 11 numbers against
sys/sys/errno.h, all match. Thanks @LeandroLP23 for the Windows run: it showed thatguest_socket_erroronly covers the table, not thatNativeError()goes through it.Added one commit on your branch, rebased on current
main:GuestUdp.cpp: sending on an unconnected UDP socket must report guestEDESTADDRREQ(39) (Linux only). Setting that table entry back toEIOmakesguest_udpabort; with the fix it passes.guest_socket_error,guest_udp,guest_tcp,guest_poll,guest_socket_pair,guest_dup,guest_socket_eventsandguest_socket_read_writepass on Linux; merging once CI is green.