diff options
author | Ariadne Conill <ariadne@dereferenced.org> | 2022-10-21 01:45:24 +0000 |
---|---|---|
committer | Ariadne Conill <ariadne@dereferenced.org> | 2022-10-21 01:45:24 +0000 |
commit | 36f21a6f96303bcb37555983bf4087bd042d8a9c (patch) | |
tree | be66beaba945bf9a0e3b5767ab1528ae3a5cda8f /libgcompat | |
parent | f23fb58690246d0526f42316c9a35274e34ffaf9 (diff) | |
download | gcompat-36f21a6f96303bcb37555983bf4087bd042d8a9c.tar.gz gcompat-36f21a6f96303bcb37555983bf4087bd042d8a9c.tar.bz2 gcompat-36f21a6f96303bcb37555983bf4087bd042d8a9c.tar.xz gcompat-36f21a6f96303bcb37555983bf4087bd042d8a9c.zip |
pthread: add pthread_mutexattr_[get|set]kind_np
Needed for Adaptec ARC configuration utility.
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
Diffstat (limited to 'libgcompat')
-rw-r--r-- | libgcompat/pthread.c | 19 |
1 files changed, 19 insertions, 0 deletions
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); +} |