summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2001-08-09 12:04:14 +0000
committerfgsch <fgsch@openbsd.org>2001-08-09 12:04:14 +0000
commite2c35f760498506ed0e5669bb350dd4c8b92e373 (patch)
tree698d6fc13f02ab053c30398a8fe9dcce41af30cf /lib/libpthread
parentDo not return EINVAL if param is NULL or the desired scheduling policy (diff)
downloadwireguard-openbsd-e2c35f760498506ed0e5669bb350dd4c8b92e373.tar.xz
wireguard-openbsd-e2c35f760498506ed0e5669bb350dd4c8b92e373.zip
Only return EINVAL if attr is invalid. If policy is invalid return
EOPNOTSUPP; from FreeBSD.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/uthread/uthread_attr_setschedpolicy.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/libpthread/uthread/uthread_attr_setschedpolicy.c b/lib/libpthread/uthread/uthread_attr_setschedpolicy.c
index f5090d987a9..8f641181906 100644
--- a/lib/libpthread/uthread/uthread_attr_setschedpolicy.c
+++ b/lib/libpthread/uthread/uthread_attr_setschedpolicy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_attr_setschedpolicy.c,v 1.2 1999/11/25 07:01:32 d Exp $ */
+/* $OpenBSD: uthread_attr_setschedpolicy.c,v 1.3 2001/08/09 12:04:14 fgsch Exp $ */
/*
* Copyright (c) 1998 Daniel Eischen <eischen@vigrid.com>.
* All rights reserved.
@@ -42,12 +42,17 @@ pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
{
int ret = 0;
- if ((attr == NULL) || (*attr == NULL) || (policy < SCHED_FIFO) ||
- (policy > SCHED_RR))
+ if ((attr == NULL) || (*attr == NULL))
ret = EINVAL;
- else
+ else if ((policy < SCHED_FIFO) || (policy > SCHED_RR)) {
+#ifdef NOT_YET
+ ret = ENOTSUP;
+#else
+ ret = EOPNOTSUPP;
+#endif
+ } else
(*attr)->sched_policy = policy;
- return(ret);
+ return (ret);
}
#endif