mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 16:43:05 -05:00
SDL queries the SCHED_OTHER range before it sets a thread priority. It gets the same 256 to 767 range as SCHED_FIFO and SCHED_RR, which pthread_setschedparam applies regardless of policy. The console's answer is unverified and recorded in TechnicalDebt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
687 B
C++
20 lines
687 B
C++
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
#include <cstdlib>
|
|
#include <stdexcept>
|
|
extern "C" {
|
|
int APS5_VABI sched_get_priority_max_nid_postfix(int policy);
|
|
int APS5_VABI sched_get_priority_min_nid_postfix(int policy);
|
|
}
|
|
static void Require(bool value) { if (!value) std::abort(); }
|
|
static bool Rejects(int policy) {
|
|
try { sched_get_priority_max_nid_postfix(policy); } catch (const std::invalid_argument&) { return true; }
|
|
return false;
|
|
}
|
|
int main() {
|
|
for (int policy : {1, 2, 3}) {
|
|
Require(sched_get_priority_max_nid_postfix(policy) == 256);
|
|
Require(sched_get_priority_min_nid_postfix(policy) == 767);
|
|
}
|
|
Require(Rejects(0) && Rejects(4));
|
|
}
|