diff options
author | davidxu <davidxu@FreeBSD.org> | 2005-10-24 05:16:41 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2005-10-24 05:16:41 +0000 |
commit | f8a456fe19aa072213e6b8c32ea9c57552970658 (patch) | |
tree | 568c2692feb7717eca1fc257c93daa2a60f87d7c /lib/libthr/thread/thr_mutexattr.c | |
parent | 34370764e1451f12b13f1388c1ac1c024004908f (diff) | |
download | FreeBSD-src-f8a456fe19aa072213e6b8c32ea9c57552970658.zip FreeBSD-src-f8a456fe19aa072213e6b8c32ea9c57552970658.tar.gz |
Add functions pthread_mutexattr_setpshared and pthread_mutexattr_getpshared.
Diffstat (limited to 'lib/libthr/thread/thr_mutexattr.c')
-rw-r--r-- | lib/libthr/thread/thr_mutexattr.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_mutexattr.c b/lib/libthr/thread/thr_mutexattr.c index 042ff87..ecfd1da 100644 --- a/lib/libthr/thread/thr_mutexattr.c +++ b/lib/libthr/thread/thr_mutexattr.c @@ -77,6 +77,8 @@ __weak_reference(_pthread_mutexattr_getkind_np, pthread_mutexattr_getkind_np); __weak_reference(_pthread_mutexattr_gettype, pthread_mutexattr_gettype); __weak_reference(_pthread_mutexattr_settype, pthread_mutexattr_settype); __weak_reference(_pthread_mutexattr_destroy, pthread_mutexattr_destroy); +__weak_reference(_pthread_mutexattr_getpshared, pthread_mutexattr_getpshared); +__weak_reference(_pthread_mutexattr_setpshared, pthread_mutexattr_setpshared); int _pthread_mutexattr_init(pthread_mutexattr_t *attr) @@ -165,3 +167,29 @@ _pthread_mutexattr_destroy(pthread_mutexattr_t *attr) } return(ret); } + +int +_pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr, + int *pshared) +{ + + if (attr == NULL || *attr == NULL) + return (EINVAL); + + *pshared = PTHREAD_PROCESS_PRIVATE; + return (0); +} + +int +_pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared) +{ + + if (attr == NULL || *attr == NULL) + return (EINVAL); + + /* Only PTHREAD_PROCESS_PRIVATE is supported. */ + if (pshared != PTHREAD_PROCESS_PRIVATE) + return (EINVAL); + + return (0); +} |