feat(libkernel_sys): implement the scePthread scope, atfork and setconcurrency forms #9141
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9141"
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 MarrasFederico on 2026-10-21T13:19:39Z.
What
scePthreadAttrGetscope,scePthreadAttrSetscope,scePthreadAtforkandscePthreadSetconcurrencywerelibkernel_sysdiscovery stubs that threw. libkernel already implements their POSIX forms (pthread_attr_getscope,pthread_attr_setscope,pthread_atfork,pthread_setconcurrency). The foursceforms now call them and turn a POSIX error into0x80020000 | errno, as #8987 does for the barrier, cpuclockid and concurrency forms; this builds on itsSceResulthelper.shadPS4 exports
scePthreadAttrGetscope(+7B2AEKKns8) asORBIS(posix_pthread_attr_getscope), the same wrapping. It has no export for the other three. Their names and NIDs (YdZfEZfRnPk,i1kREW2pchs,gdnv6wF6hwI) are in the symbol database, and their signatures follow the same POSIX forms.What they do is libkernel's behaviour:
EINVAL.EINVAL; otherwise the level is stored and read back byscePthreadGetconcurrency.The debt entry records that none of this is measured on a console.
Tested
Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with
BUILD_TESTING=ON. Windows was not compiled. No title was run.guest_kernel_sys_pthread, registered next toguest_kernel_sys_barrier(#8987, now merged):0x80020016without changing it. Null attribute or output pointers return0x80020016.0x80020016and keeps 3. 0 reads back as 0.scecode, or registering the atfork handlers in the wrong order, makes it fail.guest_kernel_sysandguest_kernel_sys_barrierstill pass.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pyfinds no shared export. It reports neighbouring lines indocs/dev/debt/libkernel_sys.mdwith #8457, #8531, #9040 and #9103 (fchown, chown and title-workaround calls), and could not compare #5021, which conflicts withmain; none touches these four calls.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 ycbuzi on 2026-10-21T20:49:29Z.
Windows run of
d6b384688amerged ontomain0c6a5bd593(a3706ed2cf, clean), the platform the description lists as not tested. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.Built
libkernel_sys,guest_kernel_sys_barrier_testsandguest_kernel_sys_pthread_testswith no errors or warnings.ctest --repeat until-fail:2onguest_kernel_sys_barrierandguest_kernel_sys_pthread: both pass on both repeats. Not run: a title.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T05:18:31Z.
Review: APPROVED
Reviewed exact head
e8f8e59a35. The dependent #8987 changes are retained, and the checklist declares that dependency. The four new SCE forms delegate to the existing POSIX providers with SCE errno mapping; tests cover scope state/error preservation, concurrency, and atfork registration order. Local diff whitespace, conventions, registration, and current-main checks pass. The PR reports a Linux full build/focused tests, and an independent Windows build plus repeated barrier/pthread runs; I did not execute those binaries locally. Hosted product jobs are skipped by policy, and console behavior remains documented as unmeasured.