fix(libc): map ENODATA, ENOSR, ENOSTR, EOTHER, and ETIME in GuestErrnoFromHost #27924
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27924"
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 gurtgg on 2026-11-27T20:32:04Z.
What
#ifdef-guardedENODATA(1040),ENOSR(1050),ENOSTR(1051),EOTHER(1062), andETIME(1074) inHostErrnoMap[]insideGuestErrnoFromHost_nid_no_patch(core/libs/prx/libc/src/HostErrno.cpp), matching the extended guest error codes defined incore/libs/prx/libc/src/Errors.cpp(with1040,1050,1051, and1074also matchingSceV2SyserrorMessageincore/libs/prx/libc/src/exception/StandardExceptions.cpp, which does not define1062), while keepingENOTRECOVERABLE(95) andEOWNERDEAD(96) unchanged.GuestErrnoFromHost_nid_no_patch(called acrossFileAndHeap.cpp,StandardStreams.cpp,AllocatingStrings.cpp,FormattingWide.cpp,libSceLibcInternal/Spawn.cpp,libScePosixForWebKit/Resolver.cpp, andlibkernel/Time/Time.cpp) from falling througherror > 0 && error <= 34and returningGuestEio(5) for those host errnos on Windows UCRT, Linux, and macOS.Tested
guest_atoi(core/libs/tests/GuestAtoi.cpp,errnoCases[]): verifies#ifdef-guardedENODATA -> 1040,ENOSR -> 1050,ENOSTR -> 1051,EOTHER -> 1062, andETIME -> 1074(negative control returning5on unmodifiedmain) alongside existing mapped errnos,ENOENT/ERANGE, and0/-1/9999fallback to5.Checklist
main; no other open PR implements the same functionstools/check_conventions.pypasses)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repositorymainand passes after fixSummary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T20:35:24Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
9ecd67a22e:tools/check_conventions.pypassed.guest_atoi_testsbuilt cleanly.guest_atoi):core/libs/prx/libc/src/HostErrno.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T20:52:34Z.
Review: APPROVED
Reviewed — looks good
The change maps the five guarded host errno values to the guest codes and adds matching cases to the existing errno test; both changed files were read at the pinned head.
What I ran
repo_read.pyat head9ecd67a22e8d56b35c56211455d8347f44c35f70.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Runtime behavior and compilation on Windows UCRT, Linux, and macOS were not verified. Files listed in the manifest as reviewed:
core/libs/prx/libc/src/HostErrno.cppandcore/libs/tests/GuestAtoi.cpp; both were read. No files were excluded by the manifest.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-11-28T05:06:07Z.
Review: APPROVED
Checked head
9ecd67a22e. All on Windows 11 with WinLibs GCC 15.2 (Release), applied tomaina163d4b886together with #27930, #27929, #27926, #27925, #27923, #27922, #27901, #27828, #27771, #27755, #27748, #27682, #27765.tools/check_conventions.py --headandtools/debt_fold.py --checkpassed and the full build succeeded.guest_atoipasses, and the five values match the guest codes inErrors.cpp(1040, 1050, 1051, 1062, 1074).guest_resolver_system_errorsalso buildsHostErrno.cpp, but it is registered only on Linux, so it did not run here. In the full CPU suite (5,120 tests) the only failures are unrelated:windows_read_trap_unknownfails onmaintoo (fixed in #28028).frame_capture_minimize,jpeg_external_toolchainandguest_pthread_mutex_contentionare timeouts under load; they pass when run on their own.guest_audio_in_capturepasses 20/20 onmainand with #27922.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:16:34Z.
Review: COMMENTED
The GuestAtoi fixture passed with the exact HostErrno.cpp change linked into the Linux test. I checked the conditional host errno mappings. The run exercises the values defined by Linux glibc, and the Windows-only branch was outside this run.
AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.