Repository navigation
feat(libkernel): implement getrlimit for RLIMIT_DATA - #1675
Conversation
99d9f99 to
cd2a5ac
Compare
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
|
CI is waiting for first-time contributor approval here, so I ran the project's Build workflow (
Overlap: no textual conflict with the open PRs that change these files ( |
cd2a5ac to
c2fe7d4
Compare
c2fe7d4 to
851f3b7
Compare
|
First Windows run, since the description says it wasn't tested on Windows. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Merged onto
🤖 Addressed by Claude Code |
|
Checked on Linux (merged onto current |
What
getrlimitin libkernel forRLIMIT_DATA(2), the only resource the importing titles read.getrlimit(RLIMIT_DATA), withRLIM_INFINITYreported as the FreeBSDRLIM_INFINITY(INT64_MAX); on Windows the job object's process memory limit, orRLIM_INFINITYwhen the process has none.kern_getrlimit: a resource outside 0..14 returns -1 withEINVAL, checked before the output pointer; a null pointer returns -1 withEFAULT.Caller: PPSA99005 (blackbearreloaded/ps5-opengl v1.0.1) imports
getrlimit(#1578; 19 of the 34 catalog titles in the audit there). In its SDK (ps5-opengl-sdk 1.0.1) the only references are in Mesa,libmesa_util.aos_misc.c.oandlibpsbc.ps5.aos_misc.ps5.o:os_get_available_system_memory(src/util/os_misc.c, FreeBSD branch) callsgetrlimit(RLIMIT_DATA)aftersysctl(CTL_HW, HW_USERMEM). Values on hardware were not measured.Log
PPSA99005 (blackbearreloaded/ps5-opengl showcase v1.0.1), relinked on Linux (Ubuntu, GCC 15.2.0,
mainf145139, bundledlibc.prxkept) and run in abwrapsandbox. Onmainit stops onmkstemp, as in #1578:With the open PRs for its earlier absent imports merged locally (#1978, #1869, #1656, #1729, #1613, #1714, #1482, #1650, #1872, #1641, #1685, #1859; no conflicts), the stops are:
Wh7HbV7JFqc(getrlimit, #1675)JZKw5+Wrnaw(pthread_sigmask, no PR yet)pthread_sigmaskexportnnoxZUHK+SA(pthread_getcpuclockid, #1676)Each stop is the loader's line, e.g.
./app.elf: symbol lookup error: ./app.elf: undefined symbol: Wh7HbV7JFqc. The throwawaypthread_sigmaskonly exports the NID and throws when called; it was not called before the abort.Tested
Ubuntu, Linux 7.0, GCC 15.2.0, full build with
BUILD_TESTING=ON. New testguest_getrlimit: matches the hostgetrlimit(RLIMIT_DATA), reports a loweredsetrlimitsoft limit,EINVAL/EFAULTorder, throws forRLIMIT_NOFILEandRLIMIT_AS. Patchedlibkernel.prxexportsWh7HbV7JFqc.The project's Build workflow on the fork (Linux, Windows MinGW, relinker on Ubuntu/Windows/macOS) passes; the run is linked in a comment below. Run with PPSA99005 as above.
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)