feat(libkernel): add getdtablesize #5061
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5061"
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 p3n1cillin on 2026-10-13T10:13:56Z.
What
VLC for PS5 (PPSA85300, catalog build) fails to load on current
main(bb9a4d8a2), now thatreaddir_r(#3635) is in:sZuwaDPATKsisgetdtablesize. This is the half of #4386 that was dropped from it; @oneandonlydean said there that it "can go in after #3635, since PPSA85300 stops atsZuwaDPATKsoncereaddir_ris in".The export throws (
NotImplemented_nid_no_patch). FreeBSD returns the smaller of theRLIMIT_NOFILEsoft limit andmaxfilesperproc(sys_getdtablesize). Neither value is known for the console, and AnyPS5'sgetrlimit(RLIMIT_NOFILE)already throws for the same reason. VLC's only caller is aclosefromloop (libc_stubs.c#L66-L72). As @AchrafReyani traced in #4386, it runs only in the child of a spawn helper whoseforkfails withENOSYS, so the call is never made. Recorded under Unknown function info indocs/dev/debt/libkernel.md.Tested
/app0/vlc-ps5.logand writes itsload address marker. It then faults inreport_unresolved_imports()(platform_ps5.c), which reads its own GOT slots at the console's fixed load address (EBOOT_BASE 0x400000) instead of the image's. That is a load-address assumption of the title, not a library call.guest_getrlimitnow also requiresgetdtablesizeto throw. All 124 libkernel tests pass on Windows; Linux was not built locally.python tools/check_conventions.py --base origin/mainpasses.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-13T10:23:27Z.
Progress report (
75690a1→c580053)📉 System libraries: 88.19% (-0.03%, +1 declared functions)
🆕 1 declared as stubs
getdtablesize_nid_postfixImported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T11:12:28Z.
Linux validation (Ubuntu 24.04, GCC 13.3, Release), this PR's commit on
mainat77b9f7270:guest_getrlimitpasses. Withmain's sources and this PR's test, the test does not link (getdtablesizeis not exported), so it covers the new export.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T11:59:07Z.
Linux run of this change: Ubuntu in WSL2, GCC 15.2.0, Ninja Release,
BUILD_TESTING=ON, full build. Built from a local integration heada14a49d8d, which ismain5d50886eewith this PR and my other open library PRs merged (#5013, #5009, #5061, #5078, #5098; no conflicts). All 121 libkernel tests and all 68 libc tests pass, includingguest_system_configuration,guest_getrlimitandguest_select. Not run alone on Linux; no title run on Linux.Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-13T18:37:35Z.
XPSemu (PPSA97358, catalog release) now stops here on
main: since #4377 merged,main18c438b1stops it at the unresolved importsZuwaDPATKs(getdtablesize), on Linux (Ubuntu 24.04, GCC 13, Release, headless). With this PR (8fce4b84, clean merge) every import resolves, andguest_getrlimitpasses.Its later stops, with this PR merged locally, for whoever picks them up:
0x400000 + offset(#4013), as described in #4593.--linux-fixed-base 0x400000, it stops atgetrlimit: unsupported resource 8(RLIMIT_NOFILE), which is #5187.radv/ps5: the GPU has not reached submission 2 (at 1) in 10 s,vk_result = -4, assertion inhw/xbox/nv2a/pgraph/vk/gpuprops.c:456(render_geom_shader_triangles). That run was headless, so it may differ with a display.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T21:46:42Z.
Windows/AMD title runs for both titles that stop here. Setup: Windows 11 (26300), Radeon 860M, WinLibs GCC 15.2.0, Release. Head
8fce4b843merged onto currentmain665ad7da7, catalog builds, 2 runs of 40 s each.Conflict: since #4374 merged, this branch conflicts with
mainincore/libs/prx/libkernel/System/src/Process.cpp.getpriority_nid_postfixandgetdtablesize_nid_postfixare added at the same place. For these runs I kept both functions; nothing else conflicted.mainmain+ this PRFAIL: unresolved ELF import sZuwaDPATKs from libkernel.prx, exit0xc0000139read of 0x000000000339c6e0atPPSA97358.exe+0xc88d9fread of 0x0000000003a2b2c8atPPSA85300.exe+0xf94c4Both faults read a small address, a GOT offset plus the console's fixed
0x400000base. That is the #4013 load-address assumption the description names, now reached by XPSemu as well. Neither title reached thegetdtablesizethrow in these runs.guest_getrlimitpasses.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T21:56:33Z.
Rebased onto
mainc7601b797(head9be93156b). TheProcess.cppconflict with #4374 is resolved by keeping bothgetpriorityandgetdtablesize, as @LeandroLP23 did, and nothing else changed. On Windows (MinGW GCC 15, Release) it builds, all 128 libkernel tests pass, and the conventions check passes. Thanks for the AMD runs: the later XPSemu and VLC faults are the #4013 fixed-base assumption, which--windows-fixed-base 0x400000(#4140) avoids.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T21:57:08Z.
One convention point on
getdtablesize_nid_postfix: this export is intentionally unimplemented, soCONTRIBUTING.mdasks it to callNotImplemented_nid_no_patch(__func__). The current custom string is descriptive, but the function name should come from__func__; the debt entry can keep the explanation about the unknown console descriptor limit.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T23:28:56Z.
The overlap notice with #5545 is an adjacent edit in
Process.cpp: #5061 addsgetdtablesize, while #5545 addssetpriority. They have no semantic dependency, but whichever lands second may need to rebase the neighboring additions. Both PRs remain open.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T04:56:42Z.
Pushed one commit switching the throw to
NotImplemented_nid_no_patch(__func__), as asked above. Merging once the full build is green.