diff options
author | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:44:09 +0000 |
---|---|---|
committer | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:44:09 +0000 |
commit | 4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b (patch) | |
tree | acd4001a266a8713495af7f1b2102b61e67113b0 /mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c | |
parent | 71b111ec6c4671667a19c6fbe0023d33422535d7 (diff) | |
download | drakx-backup-do-not-use-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.tar drakx-backup-do-not-use-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.tar.gz drakx-backup-do-not-use-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.tar.bz2 drakx-backup-do-not-use-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.tar.xz drakx-backup-do-not-use-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.zip |
Import dietlibc 0.22 + other fixes for AMD64
Diffstat (limited to 'mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c')
-rw-r--r-- | mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c b/mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c new file mode 100644 index 000000000..df007c408 --- /dev/null +++ b/mdk-stage1/dietlibc/libpthread/pthread_setschedparam.c @@ -0,0 +1,21 @@ +#include <unistd.h> +#include <errno.h> + +#include <pthread.h> +#include "thread_internal.h" + +int pthread_setschedparam(pthread_t target_thread, int policy, const struct sched_param *param) +{ + __THREAD_INIT(); + + if (__find_thread_id(target_thread)<0) { + return ESRCH; + } + + if (((policy == SCHED_OTHER) && (param->sched_priority==0)) || + (((policy == SCHED_RR) || (policy == SCHED_FIFO)) && + ((param->sched_priority > 0) && (param->sched_priority <100)))) + return sched_setscheduler(target_thread, policy, param); + + return EINVAL; +} |