// Linux 替身:mach/thread_policy.h —— 实时线程策略在 Linux 上一律失败(调用方只记日志) // Linux stand-in: mach/thread_policy.h -- real-time thread policy always fails on Linux (callers only log) #pragma once #include typedef struct { uint32_t period, computation, constraint; boolean_t preemptible; } thread_time_constraint_policy_data_t; #define THREAD_TIME_CONSTRAINT_POLICY 2 #define THREAD_TIME_CONSTRAINT_POLICY_COUNT ((mach_msg_type_number_t)(sizeof(thread_time_constraint_policy_data_t) / sizeof(int))) typedef struct { int importance; } thread_precedence_policy_data_t; #define THREAD_PRECEDENCE_POLICY 3 #define THREAD_PRECEDENCE_POLICY_COUNT 1 typedef struct { boolean_t timeshare; } thread_extended_policy_data_t; #define THREAD_EXTENDED_POLICY 1 #define THREAD_EXTENDED_POLICY_COUNT 1 static inline kern_return_t thread_policy_set(mach_port_t t, thread_policy_flavor_t f, thread_policy_t p, mach_msg_type_number_t n) { (void)t; (void)f; (void)p; (void)n; return KERN_FAILURE; } static inline kern_return_t thread_policy_get(mach_port_t t, thread_policy_flavor_t f, thread_policy_t p, mach_msg_type_number_t *n, boolean_t *def) { (void)t; (void)f; (void)p; (void)n; if (def) *def = 1; return KERN_FAILURE; }