fix(libc): return the calling thread from _Thrd_id as the console's libc.prx does

This commit is contained in:
Rookie committed 2026-10-25 01:45:47 +01:00
1 parent cf528e78c6
commit 0297073da2
4 files changed
+9 -7

No files matched your search

+3
View File
@@ -300,6 +300,7 @@ static void PadDetach() {
static void KernelKeys() {
Require(_Thrd_current_nid_postfix() == scePthreadSelf());
Require(_Thrd_id_nid_postfix() == scePthreadSelf());
int key = -1;
Require(_Tss_create_nid_postfix(&key, nullptr) == success && key >= 0);
int value = 0;
@@ -346,10 +347,12 @@ static void ForwardedCalls() {
Require(_Tss_set_nid_postfix(8, &flag) == success && forwardLog.key == 8 && forwardLog.value == &flag);
Require(_Thrd_equal_nid_postfix(&flag, &key) == 1 && forwardLog.first == &flag && forwardLog.second == &key);
Require(_Thrd_current_nid_postfix() == &forwardLog.key);
Require(_Thrd_id_nid_postfix() == &forwardLog.key);
Require(_Mtx_current_owns_nid_postfix(nullptr) == 1);
RegisterThreadForwards_nid_no_patch(nullptr);
RequireThrows<std::runtime_error>([] { _Thrd_current_nid_postfix(); });
RequireThrows<std::runtime_error>([] { _Thrd_id_nid_postfix(); });
RequireThrows<std::runtime_error>([] { _Tss_get_nid_postfix(0); });
}