summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-08 04:49:36 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-08 19:14:21 +0200
commit6e80b9fd01d602974b58532f1d7eacf7d8d4f976 (patch)
treeb2aca97201c7bb4b0a150b991f5c7e90f1dd7c6b
parent7fea58c4f1c3eb2d55bd32efe92b55d1190dd8f4 (diff)
downloadserenity-6e80b9fd01d602974b58532f1d7eacf7d8d4f976.zip
LibPthread: Add implementation for pthread_mutexattr_gettype
-rw-r--r--Userland/Libraries/LibPthread/pthread.cpp6
-rw-r--r--Userland/Libraries/LibPthread/pthread.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibPthread/pthread.cpp b/Userland/Libraries/LibPthread/pthread.cpp
index cba9533609..44fa5ab045 100644
--- a/Userland/Libraries/LibPthread/pthread.cpp
+++ b/Userland/Libraries/LibPthread/pthread.cpp
@@ -196,6 +196,12 @@ int pthread_mutexattr_settype(pthread_mutexattr_t* attr, int type)
return 0;
}
+int pthread_mutexattr_gettype(pthread_mutexattr_t* attr, int* type)
+{
+ *type = attr->type;
+ return 0;
+}
+
int pthread_attr_init(pthread_attr_t* attributes)
{
auto* impl = new PthreadAttrImpl {};
diff --git a/Userland/Libraries/LibPthread/pthread.h b/Userland/Libraries/LibPthread/pthread.h
index 536163b41f..3a0e0d6ecb 100644
--- a/Userland/Libraries/LibPthread/pthread.h
+++ b/Userland/Libraries/LibPthread/pthread.h
@@ -112,6 +112,7 @@ int pthread_detach(pthread_t);
int pthread_equal(pthread_t, pthread_t);
int pthread_mutexattr_init(pthread_mutexattr_t*);
int pthread_mutexattr_settype(pthread_mutexattr_t*, int);
+int pthread_mutexattr_gettype(pthread_mutexattr_t*, int*);
int pthread_mutexattr_destroy(pthread_mutexattr_t*);
int pthread_setname_np(pthread_t, const char*);