Merge pull request #793 from CnRJay/feat/barrierattr-process-shared

feat(libkernel): accept PTHREAD_PROCESS_SHARED barrier attributes
This commit is contained in:
Dean
2026-10-07 10:18:43 +13:00
committed by GitHub
3 changed files with 9 additions and 8 deletions
@@ -54,8 +54,7 @@ int APS5_VABI pthread_barrierattr_getpshared_nid_postfix(PthreadBarrierattrPriva
int APS5_VABI pthread_barrierattr_setpshared_nid_postfix(PthreadBarrierattrPrivate** attr, int pshared) {
if (!attr || !*attr) return 22;
if (pshared == PROCESS_SHARED) NotImplemented_nid_no_patch("pthread_barrierattr_setpshared: PTHREAD_PROCESS_SHARED");
if (pshared != PROCESS_PRIVATE) return 22;
if (pshared != PROCESS_PRIVATE && pshared != PROCESS_SHARED) return 22;
(*attr)->pshared = pshared;
return 0;
}
+7 -5
View File
@@ -66,14 +66,16 @@ int main() {
Require(pthread_barrierattr_getpshared_nid_postfix(&attr, &pshared) == 0 && pshared == PROCESS_PRIVATE);
Require(pthread_barrierattr_setpshared_nid_postfix(&attr, 2) == GUEST_EINVAL);
Require(pthread_barrierattr_setpshared_nid_postfix(&attr, -1) == GUEST_EINVAL);
bool rejected = false;
try { pthread_barrierattr_setpshared_nid_postfix(&attr, PROCESS_SHARED); }
catch (const std::runtime_error&) { rejected = true; }
Require(rejected);
Require(pthread_barrierattr_setpshared_nid_postfix(&attr, PROCESS_SHARED) == 0);
Require(pthread_barrierattr_getpshared_nid_postfix(&attr, &pshared) == 0 && pshared == PROCESS_SHARED);
Context shared;
Require(pthread_barrier_init_nid_postfix(&shared.barrier, &attr, WAITERS) == 0);
RunWaiters(shared);
Require(pthread_barrier_destroy_nid_postfix(&shared.barrier) == 0);
Require(pthread_barrierattr_setpshared_nid_postfix(&attr, PROCESS_PRIVATE) == 0);
pshared = -1;
Require(pthread_barrierattr_getpshared_nid_postfix(&attr, &pshared) == 0 && pshared == PROCESS_PRIVATE);
rejected = false;
bool rejected = false;
try { pthread_barrierattr_getpshared_nid_postfix(&attr, nullptr); }
catch (const std::invalid_argument&) { rejected = true; }
Require(rejected);
+1 -1
View File
@@ -79,7 +79,7 @@ Throughout the project, every function at every stage either **does exactly what
- [_sceLibcInternalThreadAtexit, _sceLibcInternalThreadDtors](../../core/libs/prx/libSceLibcInternal/Export.cpp) (libSceLibcInternal) - FreeBSD `__cxa_thread_atexit` semantics assumed; a null or non-image destructor and an allocation failure throw
- [_sceLibcInternalForceTlsDestructor](../../core/libs/prx/libSceLibcInternal/Export.cpp) (libSceLibcInternal) - unknown return type and behaviour; a title's `libc.prx` calls it from `__cxa_finalize` with the module handle of a non-null dso
- [__progname](../../core/libs/prx/libkernel/System/src/Process.cpp) (libkernel) - unknown data export
- [pthread_barrierattr_setpshared](../../core/libs/prx/libkernel/Pthread/Posix/Barrier.cpp) (libkernel) - PTHREAD_PROCESS_SHARED throws: FreeBSD 9.0 libthr rejects it with EINVAL and 11.0 accepts it, and which one the console follows is unknown
- [pthread_barrierattr_setpshared](../../core/libs/prx/libkernel/Pthread/Posix/Barrier.cpp) (libkernel) - PTHREAD_PROCESS_SHARED is accepted on the assumption that the console follows FreeBSD 11.0 libthr, which accepts it (9.0 rejects it with EINVAL); unverified on hardware. Guest code runs in one process, so a shared barrier behaves as a private one
- [sceSslClose](../../core/libs/prx/libSceSsl/Export.cpp) (libSceSsl) - unknown signature
- [sceSslGetSerialNumber](../../core/libs/prx/libSceSsl/Export.cpp) (libSceSsl) - unknown signature
- [X+4jdIS75P0](../../core/libs/prx/libSceAudioIn/Export.cpp) (libSceAudioIn) - unknown name, signature