fix(libkernel): export _readv, _writev, _fcntl, _fstat, __sys_socketex #5992
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5992"
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 Get-fix on 2026-10-14T18:36:58Z.
What
PS4 programs and modules built with the OpenOrbis toolchain import these libkernel names, and the samples stop at start-up without them:
FAIL: unresolved ELF import YSHRBRLn2pI(_writev, all nine samples that otherwise start),+WRlkKjZvag(_readv),t0fXUzq61Z4(_fcntl) andA0O5kF5x4LQ(_fstat, in the library sample'slibExample.prx).__sys_socketexis imported by the networking sample._readv,_writev,_fcntland_fstatforward toreadv,writev,fcntlandfstat, as_ioctlalready does._fcntlpasses its argument on as a full 64-bit value, so the record lock commands keep their whole pointer.__sys_socketexcreates a socket likesocket(); its name argument is ignored, assceNetSocketdoes.Part of the PS4 homebrew work tracked in #3093.
Tested
Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, full build with
BUILD_TESTING=ON, onmaine442f4c2e:guest_kernel_fcntl,guest_file_vectorandguest_file_timestampspass, as doguest_udp,guest_sendfileandguest_sce_net(6/6). They call each name and check what it did:_readvreads from an offset,_writevwrites swapped segments,_fstatreturns the same times asfstat,_fcntlsets descriptor flags and reads a record lock into a staticflock(in the image, above 4 GiB), and__sys_socketexmakes a TCP socket._fcntlnarrowing its argument toint, or dropping it;__sys_socketexswapping family and type;_readvreading nothing;_writevclaiming success without writing;_fstatfilling nothing.main84b01f9cd, all together one442f4c2e): with this change the nine samples start; the networking sample, a TCP server, was not run for this PR.tools/check_conventions.py --base origin/mainpasses.Not tested on Linux.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T18:37:50Z.
Progress report (
73efd94→f12d2de)📈 System libraries: 88.87% (+0.01%, +5 implemented functions)
✅ 5 implemented
__sys_socketex_nid_postfix_fcntl_nid_postfix_fstat_nid_postfix_readv_nid_postfix_writev_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:12:53Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/Socket/src/Udp.cppcore/libs/tests/GuestFileTimestamps.cppcore/libs/tests/GuestFileVector.cppcore/libs/tests/GuestKernelFcntl.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/Socket/src/Udp.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/Socket/src/Udp.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/Socket/src/Udp.cppcore/libs/prx/libkernel/File/src/Stdio.cppImported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T13:35:07Z.
I checked the overlap the bot lists. I fetched each listed pull request and, for every file it shares with this one, merged its change with
git merge-fileinto currentmain(a5e2a80c6) and intomainwith this pull request merged. A conflict that appears only in the second case is one this pull request adds.The bot lists 21 pull requests, with 41 shared files between them (
File/src/Stdio.cppandSocket/src/Udp.cpp). This pull request adds no conflict to any of them. Its additions are new functions placed after the ones they forward to.AI-assisted: yes (Claude Code). I ran these checks myself on Windows 11.
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T20:12:57Z.
Checked the five forwarders against
readv/writev/fcntl/fstat/socket, the 64-bit_fcntlargument, and the new assertions inguest_file_vector,guest_file_timestampsandguest_kernel_fcntl(all pass; the tests don't link without the change). Merging once the full Build is green.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T23:21:26Z.
Re-checked against current
main(4272979b3): merges cleanly, the five forwarders and the new assertions inguest_file_vector,guest_file_timestampsandguest_kernel_fcntlpass. Merging once the full Build is green.