pthread_getschedparam.c 360 B

1234567891011121314151617
  1. #include "pthread_impl.h"
  2. int pthread_getschedparam(pthread_t t, int *restrict policy, struct sched_param *restrict param)
  3. {
  4. int r;
  5. __lock(t->killlock);
  6. if (t->dead) {
  7. r = ESRCH;
  8. } else {
  9. r = -__syscall(SYS_sched_getparam, t->tid, param);
  10. if (!r) {
  11. *policy = __syscall(SYS_sched_getscheduler, t->tid);
  12. }
  13. }
  14. __unlock(t->killlock);
  15. return r;
  16. }