From 6e80b9fd01d602974b58532f1d7eacf7d8d4f976 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 8 May 2021 04:49:36 +0200 Subject: [PATCH] LibPthread: Add implementation for pthread_mutexattr_gettype --- Userland/Libraries/LibPthread/pthread.cpp | 6 ++++++ Userland/Libraries/LibPthread/pthread.h | 1 + 2 files changed, 7 insertions(+) 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*);