From 9097327dc1c667fc51b8e05cc7c0626fac96665d Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Mon, 14 May 2001 14:17:54 +0000 Subject: Initial revision --- .../libpthread/pthread_attr_setschedpolicy.c | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c (limited to 'mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c') diff --git a/mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c b/mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c new file mode 100644 index 000000000..e845bca32 --- /dev/null +++ b/mdk-stage1/dietlibc/libpthread/pthread_attr_setschedpolicy.c @@ -0,0 +1,25 @@ +#include +#include + +#include +#include "thread_internal.h" + +int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy) +{ + __THREAD_INIT(); + + if (policy==SCHED_OTHER) { + attr->__schedpolicy=policy; + return 0; + } + if ((policy==SCHED_FIFO) || (policy==SCHED_RR)) { + if (geteuid()==0) { + attr->__schedpolicy=policy; + return 0; + } + (*(__errno_location()))=ENOTSUP; + } + else + (*(__errno_location()))=EINVAL; + return -1; +} -- cgit v1.2.1