11 Commits
Author SHA1 Message Date
Alvaro c28f4ef157 test(libkernel): check that pthread_condattr_getclock fails with EINVAL for a null attribute
A null attribute pointer and a null or destroyed handle return EINVAL
and leave the output untouched, also with a null output pointer, which
FreeBSD never reads after the attribute check. A null output pointer
with a valid attribute still throws.
2026-10-26 22:34:15 +01:00
Piyush Sagar fd54e493dd test(libkernel): verify rejected clocks preserve condition attributes 2026-10-26 21:45:11 +05:30
Piyush Sagar f698fa222b test(libkernel): keep getter coverage compatible with clock validation 2026-10-26 21:44:54 +05:30
Piyush Sagar 947e72e4d7 feat(libkernel): implement pthread_condattr_getclock 2026-10-26 21:44:53 +05:30
Adrià 7a25f87620 Merge pull request #9500 from GitamarT045T3R/fix/libkernel-condattr-setclock
fix(libkernel): reject clocks libthr does not accept in pthread_condattr_setclock
2026-10-25 18:42:46 +01:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
SebastianandClaude Opus 5.5 bb403de88f feat(libkernel): add missing pthread attribute accessors
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QnkpF2oEMofseVz9Z7WEAC
2026-10-23 06:27:49 +00:00
Itamar Medyoni 89031ca7b9 fix(libkernel): reject clocks libthr does not accept in pthread_condattr_setclock
FreeBSD 11 libthr's pthread_condattr_setclock returns EINVAL for any clock
other than CLOCK_REALTIME, CLOCK_VIRTUAL, CLOCK_PROF and CLOCK_MONOTONIC.
scePthreadCondattrSetclock stored any clock id; it now answers
SCE_KERNEL_ERROR_EINVAL for the others, and pthread_condattr_setclock
EINVAL through it.
2026-10-22 11:04:09 +03:00
ionut27001andClaude Opus 5.5 c00c58ae34 fix(libkernel): reject PTHREAD_PROCESS_SHARED in pthread_condattr_setpshared and add pthread_condattr_getpshared
On a PS5 (firmware 12.70), of the values 0, 1, 2 and -1,
pthread_condattr_setpshared accepts only 0 and leaves the attribute
unchanged otherwise. pthread_condattr_getpshared reports 0 and returns
EINVAL for a null, uninitialized or destroyed attribute, also with a
null output. With an initialized attribute a null output crashes the
console; here it throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 00:50:09 +03:00
Nicolas FalesyandClaude Opus 5.5 05b457d49a feat(libkernel): implement pthread_condattr_setpshared
PSFlyCast (PPSA99247) imports pthread_condattr_setpshared (3BpP850hBT4)
from libkernel and fails to load without it:
"./app.elf: symbol lookup error: ./app.elf: undefined symbol: 3BpP850hBT4".

The attribute stores PTHREAD_PROCESS_PRIVATE (0) or
PTHREAD_PROCESS_SHARED (1); a null or uninitialized attribute and any
other value return EINVAL without changing it, following FreeBSD 11
libthr thr_condattr.c and pthread_mutexattr_setpshared here. Sharing
across processes is not modeled, as for mutexes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Sovthwyu4H63RMbRVha2Sy
2026-10-17 14:06:11 -04:00
milescovielloandClaude Opus 5.5 62ac8d655f fix(libkernel): return EINVAL from scePthreadCondattrSetclock and Destroy for a null attribute
Both threw std::invalid_argument for a null or uninitialized attribute.
FreeBSD's libthr returns EINVAL for one, as the other scePthread
attribute calls here already do. The clock id is still stored as
given.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 06:42:41 +00:00