feat(libkernel): implement readv and writev #3382
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3382"
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-11T09:36:55Z.
What
Exports
readv(I7ImcLds-uU) andwritev(Z2aKdxzS4KE) from libkernel as POSIX wrappers over the existingsceKernelReadvandsceKernelWritev, the same way #3005 didpreadvandpwritev: a failure returns -1 and sets the guesterrnofrom the SCE error.Ruffle Flash (PPSA68091) imports both and stops at
readvonmainc6ca798f, now that_umtx_op(#1482) andcpuset_setaffinity(#3323) are in (catalog build,eboot.binandsce_module/libc.prxunwrapped as #2605 requires; tracked in #1578):app.elf: symbol lookup error: app.elf: undefined symbol: I7ImcLds-uUFAIL: unresolved ELF import I7ImcLds-uU (readv) from libkernel.prxapp.elf: symbol lookup error: app.elf: undefined symbol: 1t1-JoZ0sZQ(sinhf)FAIL: unresolved ELF import 1t1-JoZ0sZQ (sinhf) from libSceLibcInternal.prx@AchrafReyani had a branch for the same two functions and withdrew it in favour of this one on #1578.
Tested
Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release:
guest_file_vectorpasses 5/5 (--repeat until-fail:5) on both, with no warnings inStdio.cpporGuestFileVector.cpp. The new cases read two buffers at the file position withreadvand check the bytes, the position after it, a short read at the end and 0 at EOF; write the two buffers in swapped order withwritevand check the file and the position, then write them back; and checkEINVALfor a negative count andEFAULTfor a null vector througherrno.check_conventions.pypasses.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-11T09:37:26Z.
Progress report (
097f4e2→63a4014)➖ System libraries: 85.44% (+0.0%, +2 implemented functions)
✅ 2 implemented
readv_nid_postfixwritev_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T09:43:43Z.
Checked the build and
guest_file_vectoron Linux; the new cases fail without the change (no link) and pass with it. The wrappers follow the existingpreadv/pwritevPosixFailurepattern and errno values match the tests. Merging once CI is green.