Rich Felker | 1e21e78 | 2012-11-11 15:38:04 -0500 | [diff] [blame] | 1 | #include "pthread_impl.h" |
Rich Felker | 5f12ffe | 2018-09-12 10:19:54 -0400 | [diff] [blame] | 2 | #include "lock.h" |
Rich Felker | 1e21e78 | 2012-11-11 15:38:04 -0500 | [diff] [blame] | 3 | |
| 4 | int pthread_setschedparam(pthread_t t, int policy, const struct sched_param *param) |
| 5 | { |
| 6 | int r; |
Jens Gustedt | c4bc0b1 | 2018-01-03 14:17:12 +0100 | [diff] [blame] | 7 | LOCK(t->killlock); |
Rich Felker | 526e64f | 2018-05-04 14:26:31 -0400 | [diff] [blame] | 8 | r = !t->tid ? ESRCH : -__syscall(SYS_sched_setscheduler, t->tid, policy, param); |
Jens Gustedt | c4bc0b1 | 2018-01-03 14:17:12 +0100 | [diff] [blame] | 9 | UNLOCK(t->killlock); |
Rich Felker | 1e21e78 | 2012-11-11 15:38:04 -0500 | [diff] [blame] | 10 | return r; |
| 11 | } |