feat(libkernel): implement pthread_atfork registration #4377
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4377"
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 MarcZX10 on 2026-10-12T08:14:39Z.
What
Carries the
pthread_atforkimplementation from #3628, preserving its original commit author. It records prepare/parent/child handlers in registration order and returnsENOMEMon allocation failure. Null handlers are accepted. Sinceforkis not implemented, registered handlers do not run; unload-time removal is also not modeled, and both limits are documented indocs/dev/debt/libkernel.md.Tested
guest_pthread_atfork; a Linux rebase handoff reported the full suite passing.Current title evidence
PPSA97358 has a source-level
pthread_atforkcall, but a current-main run has not shown it as the active unresolved import. XPSemu's verified first stop ismlockall(#4386). No title-unblocks claim is made until a run recordspthread_atforkas the next stop after the earlier imports are resolved.Checklist
main; no other open PR implements this functionpthread_atforkImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T08:28:04Z.
Progress report (
6d7b873→8d455b8)➖ System libraries: 87.79% (+0.0%, +1 implemented functions)
✅ 1 implemented
pthread_atfork_nid_postfixImported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T11:51:14Z.
Windows test: head
7a510b61cmerged onto currentmain3d8ffeb27(clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release,-j4: full build 0 errors; ctest with the filterguest_pthread_atfork: guest_pthread_atfork passed (1 test(s), 0 failed);python tools/check_conventions.py --base upstream/mainpassed. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T14:02:03Z.
Rebase handoff — rebased onto current
main, authorship unchanged (only aTechnicalDebt.mdunion conflict; both entries kept).Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesTo pick it up:
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:19:38Z.
#3980 (
setrlimit) is merged. Does PPSA97358 now stop atU9t5kJAWPnAon main? With that log line this can go in. The rebase needs redoing first: it deletes thesceAgcDcbSetWorkloadsActiveentry fromdocs/dev/debt/libSceAgc.md, adds thekern.arandomline todocs/dev/debt/libkernel.mda second time, and conflicts with main in both files.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:13:33Z.
I do not have a runtime log showing PPSA97358 reaches pthread_atfork after #3980. The separate XPSemu report on #4386 establishes an mlockall import stop, not an atfork call, and the original #3628 report described these stops as predictions. I will not claim title validation for this PR without that log; the PR still needs the requested rebase and current-main evidence.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:39:43Z.
Not yet. The current-main XPSemu run cited on #4386 stops first at the unresolved
mlockallimport; its separatepthread_atforkcall site has not been shown to execute or become the next unresolved import. I rebased this PR onto currentmain, kept the existing AGC debt entries, removed the duplicatekern.arandomline, and updated the atfork debt note and PR description to distinguish source-level presence from runtime reachability. The older test reports predate this rebase, so this head still needs CI and a title rerun after the earlier stop is resolved.Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T14:10:55Z.
Title run with this PR: Windows 11, MinGW GCC 15.2.0 (WinLibs), Release. Built on
main3faa9cb40merged with this PR and the other open PRs that the catalog titles need (#4377, #4379, #4374, #4383, #3798, #4863, #4105, my #5013/#5061/#5078/#5098/#5009 and the carries #5183/#5186, plus screamm'schrootbranch from #3632); every title converted from its catalog release,eboot.binkept inapp0, 60 s runs.mlockallandposix_spawnare merged),tools/import_audit.pylists no absent import and it loads. It then stops ongetrlimit: unsupported resource 8in QEMU'sos_setup_limits(#5187), and after that on the fixed 0x400000 GOT read that #4013 tracks.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T15:06:38Z.
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.
main)docs/dev/debt/libkernel.mdL168-169docs/dev/debt/libkernel.mdL168