summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/uthread_attr_setschedparam.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r/uthread/uthread_attr_setschedparam.c')
-rw-r--r--lib/libc_r/uthread/uthread_attr_setschedparam.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_attr_setschedparam.c b/lib/libc_r/uthread/uthread_attr_setschedparam.c
index 6c4166b..755bb13 100644
--- a/lib/libc_r/uthread/uthread_attr_setschedparam.c
+++ b/lib/libc_r/uthread/uthread_attr_setschedparam.c
@@ -45,6 +45,10 @@ pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param
ret = EINVAL;
else if (param == NULL) {
ret = ENOTSUP;
+ } else if ((param->sched_priority < PTHREAD_MIN_PRIORITY) ||
+ (param->sched_priority > PTHREAD_MAX_PRIORITY)) {
+ /* Return an unsupported value error. */
+ ret = ENOTSUP;
} else
(*attr)->prio = param->sched_priority;
OpenPOWER on IntegriCloud