Kept both sides of GuestLibcThreads.cpp: main's ThreadHelpers test and this PR's VersionedSync test, both called from main().
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows a DLL is only loaded when the executable imports from it. The
thread test imported nothing from libkernel, so its load-time registration
never ran and _Tss_create threw. Comparing _Thrd_current with
scePthreadSelf imports libkernel and checks the forward.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
The console's std::__sce_v2::_Throw_Cpp_error raises a
std::__sce_v2::system_error, not the unversioned std::system_error this
forwarded to. It moves to the versioned exception change, which adds that
type.
Review on #8885: the versioned unlock, wait, signal and broadcast calls
return 0 whatever the kernel returns, as the console's do (each calls the
kernel and clears eax). The test now shows the kernel failing an unowned
unlock and wait while the wrappers report success.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
The versioned Dinkumware entries operate on libkernel's own mutex,
condition and thread handles: _Mtx_init(_with_name), _Mtx_destroy,
_Mtx_lock, _Mtx_trylock, _Mtx_unlock, _Cnd_init(_with_name),
_Cnd_destroy, _Cnd_wait, _Cnd_signal, _Cnd_broadcast, _Thrd_detach,
_Thrd_join, _Thrd_yield, _Thrd_id and _Throw_Cpp_error. libkernel
registers the pthread calls with libc next to the C11 forwards.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
_Call_once, _Tss_create, _Tss_delete, _Tss_get, _Tss_set, _Thrd_equal,
_Thrd_current and _Thrd_exit call scePthreadOnce, scePthreadKeyCreate,
scePthreadKeyDelete, scePthreadGetspecific, scePthreadSetspecific,
scePthreadEqual, scePthreadSelf and scePthreadExit and return their
results unchanged, as the console's libSceLibcInternal does.
_Mtx_current_owns returns 1 there. libkernel registers the calls with
libc at load, next to the pthread_create registration.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
Animal Well (PPSA22520) imports _Thrd_detach (L7f7zYwBvZA) from libc.prx and nothing exports it, so the Windows loader stops at startup. Register libkernel's pthread_detach with libc like pthread_create and pthread_join, and return _Thrd_error (4) when it fails.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GtXavMkgCTCdmRpweviHcQ
Add missing libc.prx symbols required by Unity IL2CPP runtime:
- Implement _Dtest double classification in Math.cpp
- Implement _Inf double constant in Math.cpp
- Implement sceLibcBacktraceGetBufferSize and sceLibcBacktraceSelf in Backtrace.cpp
- Implement _Cnd_signal in Threads.cpp
- Implement _ZNSt8ios_base7_AddstdEPS_ in RuntimeSupport.cpp
- Implement __pointer_type_info and __function_type_info vtables in TypeInfo.cpp
- Remove duplicate stubs from libSceAmpr/Export.cpp
- Add unit tests in GuestMath.cpp and GuestLibcThreads.cpp
- Document unverified behaviors in docs/dev/debt/libc.md