diff options
Diffstat (limited to 'src/thread/pthread_setschedprio.c')
-rw-r--r-- | src/thread/pthread_setschedprio.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/thread/pthread_setschedprio.c b/src/thread/pthread_setschedprio.c new file mode 100644 index 0000000..fc2e13d --- /dev/null +++ b/src/thread/pthread_setschedprio.c @@ -0,0 +1,14 @@ +#include "pthread_impl.h" +#include "lock.h" + +int pthread_setschedprio(pthread_t t, int prio) +{ + int r; + sigset_t set; + __block_app_sigs(&set); + LOCK(t->killlock); + r = !t->tid ? ESRCH : -__syscall(SYS_sched_setparam, t->tid, &prio); + UNLOCK(t->killlock); + __restore_sigs(&set); + return r; +} |