From 6d1ef1d459abf5b0edb371270ae0a893690df704 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sun, 14 Jul 2002 07:01:41 +0000 Subject: Add both pthread_mutexattr_setpshared() and pthread_mutexattr_getpshared(), which were missing -Erik --- libpthread/linuxthreads/mutex.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libpthread/linuxthreads') diff --git a/libpthread/linuxthreads/mutex.c b/libpthread/linuxthreads/mutex.c index 2123d00bc..2caf8f8ed 100644 --- a/libpthread/linuxthreads/mutex.c +++ b/libpthread/linuxthreads/mutex.c @@ -170,6 +170,24 @@ weak_alias (__pthread_mutexattr_gettype, pthread_mutexattr_gettype) weak_alias (__pthread_mutexattr_gettype, __pthread_mutexattr_getkind_np) weak_alias (__pthread_mutexattr_getkind_np, pthread_mutexattr_getkind_np) +int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, int *pshared) +{ + *pshared = PTHREAD_PROCESS_PRIVATE; + return 0; +} +weak_alias (__pthread_mutexattr_getpshared, pthread_mutexattr_getpshared) + +int __pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared) +{ + if (pshared != PTHREAD_PROCESS_PRIVATE && pshared != PTHREAD_PROCESS_SHARED) + return EINVAL; + /* For now it is not possible to shared a conditional variable. */ + if (pshared != PTHREAD_PROCESS_PRIVATE) + return ENOSYS; + return 0; +} +weak_alias (__pthread_mutexattr_setpshared, pthread_mutexattr_setpshared) + /* Once-only execution */ static pthread_mutex_t once_masterlock = PTHREAD_MUTEX_INITIALIZER; -- cgit v1.2.3