From e090a5f0d7c8d4718c5848143b0b5ca469a9e595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Miko=C5=82ajczyk?= Date: Sat, 17 May 2025 14:38:48 +0100 Subject: [PATCH] Interpret (PthreadT)-1 as current thread in posix_pthread_setaffinity_np --- src/core/libraries/kernel/threads/pthread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/libraries/kernel/threads/pthread.cpp b/src/core/libraries/kernel/threads/pthread.cpp index 61310bfb5..b2214924f 100644 --- a/src/core/libraries/kernel/threads/pthread.cpp +++ b/src/core/libraries/kernel/threads/pthread.cpp @@ -585,6 +585,9 @@ int PS4_SYSV_ABI posix_pthread_setaffinity_np(PthreadT thread, size_t cpusetsize if (thread == nullptr || cpusetp == nullptr) { return POSIX_EINVAL; } + if (thread == reinterpret_cast(-1)) { + thread = posix_pthread_self(); + } auto* attr_ptr = &thread->attr; if (const auto ret = posix_pthread_attr_setaffinity_np(&attr_ptr, cpusetsize, cpusetp)) { return ret;