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_setschedparam.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_setschedparam.c')
-rw-r--r-- | lib/libpthread/thread/thr_setschedparam.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/libpthread/thread/thr_setschedparam.c b/lib/libpthread/thread/thr_setschedparam.c index f080d5d..bce965f 100644 --- a/lib/libpthread/thread/thr_setschedparam.c +++ b/lib/libpthread/thread/thr_setschedparam.c @@ -43,14 +43,16 @@ pthread_setschedparam(pthread_t pthread, int policy, { int old_prio, in_readyq = 0, ret = 0; - if ((param == NULL) || (param->sched_priority < PTHREAD_MIN_PRIORITY) || - (param->sched_priority > PTHREAD_MAX_PRIORITY) || - (policy < SCHED_FIFO) || (policy > SCHED_RR)) + if ((param == NULL) || (policy < SCHED_FIFO) || (policy > SCHED_RR)) { /* Return an invalid argument error: */ ret = EINVAL; + } else if ((param->sched_priority < PTHREAD_MIN_PRIORITY) || + (param->sched_priority > PTHREAD_MAX_PRIORITY)) { + /* Return an unsupported value error. */ + ret = ENOTSUP; /* Find the thread in the list of active threads: */ - else if ((ret = _find_thread(pthread)) == 0) { + } else if ((ret = _find_thread(pthread)) == 0) { /* * Defer signals to protect the scheduling queues from * access by the signal handler: |