Repository navigation
fix(kernel): return guest errors from scalar file operations - #2144
erick-dsnk wants to merge 4 commits into
Conversation
|
Windows results for 757cadf: Windows 11 Pro 25H2 (10.0.26200.9457), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, full build plus
One semantic point on that case. In FreeBSD 11, AI-assisted: yes |
|
Which title hits one of the read/write/lseek throws on main? Please add the title ID and the log line; that's what makes this change of behaviour needed. Separately, |
# Conflicts: # docs/dev/TechnicalDebt.md
|
Which title hits one of the read/write/lseek throws on main? That question is still open. Please also rebase instead of merging main (c6f88c3); it conflicts in |
|
Additional platform validation on standalone PR head Windows: passed — Windows 11, supported WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja. Release / Tests: Reproduce after building the test targets: Integration limitation: a local merge against main |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the work and the Windows runs. Before this can land:
oneandonlydeanasked twice (2026-10-09, 2026-10-10) which title hits one of thesceKernelRead/sceKernelWrite/sceKernelLseekthrows onmain; please add the title ID and the log line. This is a behaviour change (throw → error return) and needs that evidence.- The PR conflicts with
mainincore/libs/prx/libkernel/File/src/Open.cpp. Please rebase instead of mergingmain(dropc6f88c39); PRs must not contain merge commits. SceErrorFromErrno(Open.cpp:152) maps every unlisted errno toEIO. That is a plausible but unverified result wheremainthrew; either list only errnos the console is known to return and throw for the rest, or cite the source for the fallback.- The progress report flags
sceKernelLseekas reverted to a stub (whence 3/4 throw). Keep it counted by implementingSEEK_DATA/SEEK_HOLE, or say in the PR why the regression is intended. docs/dev/TechnicalDebt.md:264is the line you add; after rebasing, keep it away from the end of its section to avoid adjacency conflicts.
|
Closing: main already returns the guest error from |
What
Return encoded guest errors from
sceKernelRead,sceKernelWrite, andsceKernelLseekfor invalid descriptors, buffers, offsets, and whence values. Translate host errno symbols to guest constants so host-specific numbering (includingEAGAIN) does not leak into the guest ABI. Zero-length null-buffer operations still reach the native call so invalid descriptors reportEBADF.For
sceKernelLseek, whence values outside 0–4 return guestEINVAL. FreeBSD 11 defines 3 and 4 asSEEK_DATAandSEEK_HOLE; these valid modes throw as unsupported because sparse-file seeking is not implemented. The console behavior of those modes is unverified and recorded in TechnicalDebt.Tested
Linux x86-64: incremental full
libsbuild;guest_file_vector,guest_filesystem, andguest_aiotests passed; conventions check against the PR base passed. The new seek regression failed when tested against the old 0–2 guard and passed after restoring the fix.Windows 11 results were reported for the previous head
757cadfe; that run does not cover this seek-mode correction. The current head was not runtime-tested on Windows.Checklist
main; no other open PR implements the same functions