summaryrefslogtreecommitdiff
path: root/libpthread
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-07-14 07:01:41 +0000
committerEric Andersen <andersen@codepoet.org>2002-07-14 07:01:41 +0000
commit6d1ef1d459abf5b0edb371270ae0a893690df704 (patch)
treec6345f69ce8c09c5372becbcbc827218c7b286ba /libpthread
parent252f321a08fdc29c103591834fbf01945db59ff0 (diff)
Add both pthread_mutexattr_setpshared() and
pthread_mutexattr_getpshared(), which were missing -Erik
Diffstat (limited to 'libpthread')
-rw-r--r--libpthread/linuxthreads/mutex.c18
1 files changed, 18 insertions, 0 deletions
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;