summaryrefslogtreecommitdiff
path: root/lib/libthr/thread/thr_mutexattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_mutexattr.c')
-rw-r--r--lib/libthr/thread/thr_mutexattr.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/libthr/thread/thr_mutexattr.c b/lib/libthr/thread/thr_mutexattr.c
index 7c48ed2263dc..fa349cfc756b 100644
--- a/lib/libthr/thread/thr_mutexattr.c
+++ b/lib/libthr/thread/thr_mutexattr.c
@@ -176,8 +176,7 @@ _pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr,
if (attr == NULL || *attr == NULL)
return (EINVAL);
-
- *pshared = PTHREAD_PROCESS_PRIVATE;
+ *pshared = (*attr)->m_pshared;
return (0);
}
@@ -185,13 +184,11 @@ int
_pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared)
{
- if (attr == NULL || *attr == NULL)
+ if (attr == NULL || *attr == NULL ||
+ (pshared != PTHREAD_PROCESS_PRIVATE &&
+ pshared != PTHREAD_PROCESS_SHARED))
return (EINVAL);
-
- /* Only PTHREAD_PROCESS_PRIVATE is supported. */
- if (pshared != PTHREAD_PROCESS_PRIVATE)
- return (EINVAL);
-
+ (*attr)->m_pshared = pshared;
return (0);
}