summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-08-09 12:04:15 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-08-09 12:04:15 +0000
commit9dbad4f5539700e08d0bab4a256c1c9014e73148 (patch)
treeea4f614c6655fb1832f4bd4b4c0c4526dd74d90c
parenta61b5e0da10bb912f371044395af945a62c3d5ed (diff)
Only return EINVAL if attr is invalid. If policy is invalid return
EOPNOTSUPP; from FreeBSD.
-rw-r--r--lib/libc_r/uthread/uthread_attr_setschedpolicy.c15
-rw-r--r--lib/libpthread/uthread/uthread_attr_setschedpolicy.c15
2 files changed, 20 insertions, 10 deletions
diff --git a/lib/libc_r/uthread/uthread_attr_setschedpolicy.c b/lib/libc_r/uthread/uthread_attr_setschedpolicy.c
index f5090d987a9..8f641181906 100644
--- a/lib/libc_r/uthread/uthread_attr_setschedpolicy.c
+++ b/lib/libc_r/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
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