From 36f21a6f96303bcb37555983bf4087bd042d8a9c Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Oct 2022 01:45:24 +0000 Subject: pthread: add pthread_mutexattr_[get|set]kind_np Needed for Adaptec ARC configuration utility. Signed-off-by: Ariadne Conill --- libgcompat/pthread.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libgcompat/pthread.c b/libgcompat/pthread.c index eeeddf1..ddc74ee 100644 --- a/libgcompat/pthread.c +++ b/libgcompat/pthread.c @@ -77,3 +77,22 @@ void __sched_cpufree(cpu_set_t *__set) { return CPU_FREE(__set); } + +/** + * Gets the mutex kind (non-portable variant). + */ +int pthread_mutexattr_getkind_np(const pthread_mutexattr_t *attr, int *kind) +{ + return pthread_mutexattr_gettype(attr, kind); +} + +/** + * Sets the mutex kind (non-portable variant). + */ +int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind) +{ + if (kind > PTHREAD_MUTEX_ERRORCHECK || kind < PTHREAD_MUTEX_NORMAL) + return EINVAL; + + return pthread_mutexattr_settype(attr, kind); +} -- cgit v1.2.3-70-g09d2