feat(libkernel): implement pthread_condattr_getclock #8010
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8010"
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 Piyush-Sagar on 2026-10-19T17:34:32Z.
What
Add the missing libkernel
pthread_condattr_getclockexport (NIDcTDYxTUNPhM). A live initialized attribute reports its stored signed 32-bit clock ID without changing the attribute or guest errno. Declare the getter in the shared libkernel API header and use the shared libc declarations in its regression test.The signature and opaque handle follow the public PS5 payload SDK's pthread.h and _pthreadtypes.h; sys/_types.h supplies the 32-bit clock type. Valid-input behavior follows FreeBSD 11.4 libthr. This is public SDK/reference evidence; no PS5 hardware verification is claimed.
Null attribute pointers, null handles and null outputs call
NotImplemented_nid_no_patch; their console error/fault behavior remains unverified. Inaccessible non-null pointers and copied dangling handles are not validated, and concurrent mutation/destruction is not synchronized. These gaps remain indocs/dev/debt/libkernel.md.Getter regression coverage checks initialized defaults, both setters using clocks
{0, 1, 2, Monotonic}, independent attributes, output canaries, unchanged handles/errno, and refusal of null arguments and original handles cleared by both destroy functions. Main's rejected-clock cases and SCE/POSIX pshared checks are preserved. After each rejected SCE and POSIX setter, the getter must report the previously storedMonotonicclock.Dependency #9500 is merged. This branch is rebased onto main with its
{0, 1, 2, 4}setter allowlist and rejection tests; the setter implementation is unchanged by this PR.Depends on: #9500records the completed landing order.Related prior work: closed, unmerged #3930 proposed this getter alongside additional SCE/pshared exports. This PR is limited to the POSIX getter.
Tested
Verified on 2026-10-26: Windows 11 Pro 10.0.26300, supported WinLibs MinGW-w64 GCC 15.2.0 r7 (
x86_64-ucrt-posix-seh), Ninja, Release,BUILD_TESTING=ON,ANYPS5_RELINKER_ONLY=OFF. Headfd54e493dd4873e5d63bddbb614b6613637027ebis rebased onto main518d36eaec0ac37870a17b465bedb5551be91b42, which includes #9500.patched_libraries,guest_cond_timedwait,guest_pthread_condattr,guest_cond_recursive_mutex,guest_cond_unowned_mutex.427dd36164bbc1e7960c85c8e84dca75017c88f8. Its duplicate getter finding is this PR's previous head. Comparisons involving 35 other PRs' shared debt/header files could not complete because those PRs conflict with main; no clean-overlap claim is made.The current refresh was not tested on Linux, on a PS5, or with a title; the full test suite was not run. No performance or game-unblocking claim is made. Full upstream Linux/Windows CI requires a maintainer-triggered Build workflow for PR 8010. The post-#9500 rebase and rejected-setter preservation checks are complete.
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 MarcZX10 on 2026-10-22T01:32:28Z.
The overlap scan flags the
GuestPthreadCondattr.cppcases shared with #9500. Your getter regression currently stores clock IDs 5 and 12 and expects the getter to return them, while #9500 changes the setter to reject those IDs per FreeBSD libthr. Please coordinate with #9500’s author on which lands first and update the second PR’s test/checklist so both changes compose.