blob: 038d13d8acfb4cbd01aa573cd05c791fe2ef0b95 [file] [log] [blame]
Rich Felker1e21e782012-11-11 15:38:04 -05001#include "pthread_impl.h"
Rich Felker5f12ffe2018-09-12 10:19:54 -04002#include "lock.h"
Rich Felker1e21e782012-11-11 15:38:04 -05003
4int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *param)
5{
6 int r;
Jens Gustedtc4bc0b12018-01-03 14:17:12 +01007 LOCK(t->killlock);
Rich Felker526e64f2018-05-04 14:26:31 -04008 r = !t->tid ? ESRCH : -__syscall(SYS_sched_setscheduler, t->tid, policy, param);
Jens Gustedtc4bc0b12018-01-03 14:17:12 +01009 UNLOCK(t->killlock);
Rich Felker1e21e782012-11-11 15:38:04 -050010 return r;
11}