diff options
author | jasone <jasone@FreeBSD.org> | 2000-05-02 06:51:40 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2000-05-02 06:51:40 +0000 |
commit | 03d029f134f6886d414e869610af3f09054ef37e (patch) | |
tree | d5f8485897f9957f144321659a45c86542f4d63d /lib/libpthread/thread/thr_attr_setscope.c | |
parent | 548e56c9d24f4f96bf7751d190bf456f023ac145 (diff) | |
download | FreeBSD-src-03d029f134f6886d414e869610af3f09054ef37e.zip FreeBSD-src-03d029f134f6886d414e869610af3f09054ef37e.tar.gz |
Add missing man pages. Fix various compliance bugs, mostly having to do with
error return values. Implement pthread_mutexattr_gettype().
PR: docs/16537, docs/17538
Diffstat (limited to 'lib/libpthread/thread/thr_attr_setscope.c')
-rw-r--r-- | lib/libpthread/thread/thr_attr_setscope.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/libpthread/thread/thr_attr_setscope.c b/lib/libpthread/thread/thr_attr_setscope.c index 84239d7..de2fe8e 100644 --- a/lib/libpthread/thread/thr_attr_setscope.c +++ b/lib/libpthread/thread/thr_attr_setscope.c @@ -41,21 +41,14 @@ pthread_attr_setscope(pthread_attr_t *attr, int contentionscope) { int ret = 0; - if ((attr == NULL) || (*attr == NULL) || - (contentionscope != PTHREAD_SCOPE_PROCESS) || - (contentionscope != PTHREAD_SCOPE_SYSTEM)) + if ((attr == NULL) || (*attr == NULL)) { /* Return an invalid argument: */ ret = EINVAL; - - else if (contentionscope == PTHREAD_SCOPE_SYSTEM) - /* We don't support system wide contention: */ -#ifdef NOT_YET + } else if ((contentionscope != PTHREAD_SCOPE_PROCESS) || + (contentionscope != PTHREAD_SCOPE_SYSTEM)) { + /* We don't support PTHREAD_SCOPE_SYSTEM. */ ret = ENOTSUP; -#else - ret = EOPNOTSUPP; -#endif - - else + } else (*attr)->flags |= contentionscope; return(ret); |