fix(libkernel): store the process resource limit #8537
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8537"
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 elieh999 on 2026-10-20T15:32:30Z.
What
Store
RLIMIT_NPROCupdates instead of throwing. The requested soft and hard limits are clamped to FreeBSD's 1–1443 range, and latergetrlimitcalls return the stored values.This matches the measured PS5 behavior where setting the initial 1604 limit leaves both values at 1443. The focused test now covers the initial value, the upper clamp, the lower clamp, and infinity.
Tested
Windows 11, WinLibs MinGW-w64 GCC 15.2.0 r7, Release:
guest_setrlimitpassed through CTest.python tools/check_conventions.py --base origin/maincompleted with zero errors.git diff --check origin/main...HEADpassed.python tools/pr_overlap.py --branch fix/setrlimit-nproccompleted; manually reviewed its stale-base warnings and found no other open PR implementingsetrlimitorRLIMIT_NPROC.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)Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T22:38:37Z.
Independent Windows run of this PR (data only).
Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against
main339217ebc9is clean. I built onlyguest_setrlimit_tests;ctest -N -R guest_setrlimitlists exactly one test.Results (3 runs each):
guest_setrlimitpasses 3/3.core/libs/prx/libkernel/System/src/Process.cppwith itsmainversion, then rebuilt. The test fails 3/3 (exit 0xc0000409, a failedRequire). I restored the PR'sProcess.cppafterwards.Not run: other platforms, the other process tests, the full repository CTest, and any title or console run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T09:45:18Z.
Linux data point for
bb396009e0: WSL2 Ubuntu 24.04 (a virtualised kernel, not bare-metal Linux), GCC 13.3.0, Release,BUILD_TESTING=ON, PR head alone (not merged ontomain).ctest -R '^guest_setrlimit$'passes 3 of 3.core/libs/prx/libkernel/System/src/Process.cpprestored to the merge-base (new test kept): fails (Subprocess aborted).Not tested: macOS, Windows, a title run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T05:38:49Z.
@elieh999 a merge-order note: #9477 adds an entry to
docs/dev/debt/libkernel.mda few lines below thesetrlimitentry this PR edits, and the two conflict in that file only. Their code doesn't meet. Neither needs to wait for the other: if this PR merges first, #9477 rebases and keeps your entry, and if #9477 merges first, I can put the resolved file on a branch of my fork for you to take.