summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorBrian Gianforcaro <b.gianfo@gmail.com>2021-04-21 02:13:39 -0700
committerLinus Groh <mail@linusgroh.de>2021-04-21 13:13:23 +0200
commit5a31ca06db58a121f11b698e03a2b228d4349dc1 (patch)
treeda3048543b05b08d7a8abfe2c627e113493a402b /Userland/Libraries
parent14f6425b8fd8f54942a79b121467f9605db8da50 (diff)
downloadserenity-5a31ca06db58a121f11b698e03a2b228d4349dc1.zip
LibPthread: Add non functional pthread_attr_[set|get]scope stubs
Standard: https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getscope.html Needed for https://fio.readthedocs.io
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibPthread/pthread.cpp10
-rw-r--r--Userland/Libraries/LibPthread/pthread.h6
2 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Libraries/LibPthread/pthread.cpp b/Userland/Libraries/LibPthread/pthread.cpp
index b8f1ca1a71..f5e1d19603 100644
--- a/Userland/Libraries/LibPthread/pthread.cpp
+++ b/Userland/Libraries/LibPthread/pthread.cpp
@@ -436,6 +436,16 @@ int pthread_attr_setstacksize(pthread_attr_t* attributes, size_t stack_size)
return 0;
}
+int pthread_attr_getscope([[maybe_unused]] const pthread_attr_t* attributes, [[maybe_unused]] int* contention_scope)
+{
+ return 0;
+}
+
+int pthread_attr_setscope([[maybe_unused]] pthread_attr_t* attributes, [[maybe_unused]] int contention_scope)
+{
+ return 0;
+}
+
int pthread_getschedparam([[maybe_unused]] pthread_t thread, [[maybe_unused]] int* policy, [[maybe_unused]] struct sched_param* param)
{
return 0;
diff --git a/Userland/Libraries/LibPthread/pthread.h b/Userland/Libraries/LibPthread/pthread.h
index 4c11c0089c..d977f86946 100644
--- a/Userland/Libraries/LibPthread/pthread.h
+++ b/Userland/Libraries/LibPthread/pthread.h
@@ -68,6 +68,12 @@ int pthread_attr_setstack(pthread_attr_t* attr, void*, size_t);
int pthread_attr_getstacksize(const pthread_attr_t*, size_t*);
int pthread_attr_setstacksize(pthread_attr_t*, size_t);
+#define PTHREAD_SCOPE_SYSTEM 0
+#define PTHREAD_SCOPE_PROCESS 1
+
+int pthread_attr_getscope(const pthread_attr_t*, int*);
+int pthread_attr_setscope(pthread_attr_t*, int);
+
int pthread_once(pthread_once_t*, void (*)(void));
#define PTHREAD_ONCE_INIT 0
void* pthread_getspecific(pthread_key_t key);