From 96e8c8a4e54a19a663a0aab33bf74edc1b343c02 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 7 Dec 2019 15:32:48 +0100 Subject: [PATCH] LibPthread: Add stubs for pthread_{get,set}schedparam() These should be the last thing needed to make SDL build with threads support. I think we can survive just fine with stubs of these for now, especially given that the kernel doesn't care super much about thread priorities anyway. --- Libraries/LibPthread/pthread.cpp | 16 ++++++++++++++++ Libraries/LibPthread/pthread.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/Libraries/LibPthread/pthread.cpp b/Libraries/LibPthread/pthread.cpp index d9845f1478..8e553b59ae 100644 --- a/Libraries/LibPthread/pthread.cpp +++ b/Libraries/LibPthread/pthread.cpp @@ -371,6 +371,22 @@ int pthread_attr_setstacksize(pthread_attr_t* attributes, size_t stack_size) return 0; } +int pthread_getschedparam(pthread_t thread, int* policy, struct sched_param* param) +{ + (void)thread; + (void)policy; + (void)param; + return 0; +} + +int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param* param) +{ + (void)thread; + (void)policy; + (void)param; + return 0; +} + struct WaitNode : public InlineLinkedListNode { bool waiting { true }; WaitNode* m_next { nullptr }; diff --git a/Libraries/LibPthread/pthread.h b/Libraries/LibPthread/pthread.h index 489a09aae0..986a6b376f 100644 --- a/Libraries/LibPthread/pthread.h +++ b/Libraries/LibPthread/pthread.h @@ -46,6 +46,9 @@ int pthread_once(pthread_once_t*, void (*)()); void* pthread_getspecific(pthread_key_t key); int pthread_setspecific(pthread_key_t key, const void* value); +int pthread_getschedparam(pthread_t thread, int* policy, struct sched_param* param); +int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param* param); + #define PTHREAD_MUTEX_NORMAL 0 #define PTHREAD_MUTEX_RECURSIVE 1 #define PTHREAD_MUTEX_INITIALIZER 0