Skip to content

Commit 3208ea1

Browse files
authored
Merge pull request managarm#1657 from Dennisbonke/mlibc-linux-1
2 parents 1e2dd8f + 8246ae4 commit 3208ea1

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

options/posix/generic/pthread.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,3 +1409,13 @@ int pthread_spin_unlock(pthread_spinlock_t *__lock) {
14091409
__atomic_store_n(&__lock->__lock, 0, __ATOMIC_RELEASE);
14101410
return 0;
14111411
}
1412+
1413+
int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *, int) {
1414+
__ensure(!"Not implemented");
1415+
__builtin_unreachable();
1416+
}
1417+
1418+
int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *__restrict, int *__restrict) {
1419+
__ensure(!"Not implemented");
1420+
__builtin_unreachable();
1421+
}

options/posix/include/pthread.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ extern "C" {
8282

8383
#define PTHREAD_ATTR_NO_SIGMASK_NP (-1)
8484

85+
#ifdef __MLIBC_XOPEN
86+
#define PTHREAD_RWLOCK_PREFER_READER_NP 0
87+
#define PTHREAD_RWLOCK_PREFER_WRITER_NP 1
88+
#define PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP 2
89+
#endif /* __MLIBC_XOPEN */
90+
8591
#include <bits/posix/pthread_types.h>
8692

8793
#ifndef __MLIBC_ABI_ONLY
@@ -293,6 +299,12 @@ int pthread_spin_lock(pthread_spinlock_t *__lock);
293299
int pthread_spin_trylock(pthread_spinlock_t *__lock);
294300
int pthread_spin_unlock(pthread_spinlock_t *__lock);
295301

302+
#ifdef __MLIBC_XOPEN
303+
int pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *__attr, int __pref);
304+
int pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *__restrict __attr,
305+
int *__restrict __pref);
306+
#endif /* __MLIBC_XOPEN */
307+
296308
#endif /* !__MLIBC_ABI_ONLY */
297309

298310
#ifdef __cplusplus

0 commit comments

Comments
 (0)