feat(libkernel): implement preadv and pwritev #3005
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3005"
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 babyhuey on 2026-10-10T20:23:29Z.
What
Implements
preadv(ZaRzaapAZwM) andpwritev(FCcmRZhWtOk) in libkernel as POSIX wrappers over the existingsceKernelPreadvandsceKernelPwritev(#806): the byte count on success, and -1 with the guest errno (EINVAL,EFAULT,EBADF) instead of the SCE error code on failure.Prospero Explorer (PPSA99109), Prospero Multi Tools (PPSA99110) and Prospero Vibrate (PPSA99920) stop at
preadvonmain56fb1b3band atpwritevright after it (catalog builds,eboot.binandsce_module/libc.prxunwrapped as #2605 requires; tracked in #1578):main, Linux:app.elf: symbol lookup error: app.elf: undefined symbol: ZaRzaapAZwMpreadvalone, Linux:app.elf: symbol lookup error: app.elf: undefined symbol: FCcmRZhWtOk(pwritev)YeU23Szo3BM(sceKernelGetAllowedSdkVersionOnSystem), Multi ToolsaML18Z0J0t0(sceKernelGetProsperoSystemSwVersion), VibrateY2OqwJQ3lr8(sync)Tested
Linux (Ubuntu 24.04, GCC 13, Release) on
56fb1b3b:guest_file_vectorpasses 5/5 (--repeat until-fail:5). The new cases read and write at an offset through both wrappers, check the file contents and that the file position doesn't move, check 0 at end of file, and check -1 withEINVALfor a negative offset or count andEFAULTfor a null vector.check_conventions.pypasses. Windows 11 (MinGW-w64 GCC 15.2 from WinLibs, Release), which has its ownTransferIovecspath:guest_file_vector5/5 with no warnings,mainstops atFAIL: unresolved ELF import ZaRzaapAZwM (preadv) from libkernel.prxfor all three, and with this PR they reach the same next stops as on Linux (for exampleFAIL: unresolved ELF import Y2OqwJQ3lr8 (sync) from libkernel.prxfor Vibrate).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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T20:23:50Z.
Progress report (
56fb1b3→0c2d852)📈 System libraries: 84.45% (+0.01%, +2 implemented functions)
✅ 2 implemented
preadv_nid_postfixpwritev_nid_postfixImported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-10T20:39:17Z.
With this PR and
sync(Y2OqwJQ3lr8, Vibrate's next stop above; ready on babyhuey:feat/libkernel-sync 1d2cd9ae, a wrapper oversceKernelSync), Prospero Vibrate (PPSA99920) resolves every import and runs on Windows 11 (MinGW-w64 GCC 15.2, Release,main56fb1b3b, RTX 3080):Swapchain created extent=1484x835 images=2), opens a window titledProspero Vibrate | FPS: 14.38 (419)and stays up until killed (still running after 60 s, and again after 30 s on a second launch).sceFontOpenFontSetandsceKernelOpenon/dev/urandomand/data/prospero-vibrate/patterns; no controller was attached, so the motors were not exercised.On Linux the same build runs until
DisplayWindowfinds no Vulkan display in the headless test container. I'll opensyncas its own PR once this one is in, since it's only Vibrate's next stop after it.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T21:52:55Z.
Checked the build and
guest_file_vectoron Linux; the new cases fail without the change (the wrappers don't exist) and pass with it. Wrappers follow the existingPosixFailurepattern, errno values match the tests; merging once CI is green.