1*4b169a6bSchristos /* Compiler options: 2*4b169a6bSchristos #cc: additional_flags=-pthread 3*4b169a6bSchristos #progos: linux 4*4b169a6bSchristos 5*4b169a6bSchristos A sanity check for syscalls resulting from 6*4b169a6bSchristos pthread_getschedparam and pthread_setschedparam. */ 7*4b169a6bSchristos 8*4b169a6bSchristos #include <pthread.h> 9*4b169a6bSchristos #include <stdio.h> 10*4b169a6bSchristos #include <stdlib.h> 11*4b169a6bSchristos main(void)12*4b169a6bSchristosint main (void) 13*4b169a6bSchristos { 14*4b169a6bSchristos struct sched_param param; 15*4b169a6bSchristos int policy; 16*4b169a6bSchristos 17*4b169a6bSchristos if (pthread_getschedparam (pthread_self (), &policy, ¶m) != 0 18*4b169a6bSchristos || policy != SCHED_OTHER 19*4b169a6bSchristos || param.sched_priority != 0) 20*4b169a6bSchristos abort (); 21*4b169a6bSchristos 22*4b169a6bSchristos if (pthread_setschedparam (pthread_self (), SCHED_OTHER, ¶m) != 0 23*4b169a6bSchristos || param.sched_priority != 0) 24*4b169a6bSchristos abort (); 25*4b169a6bSchristos 26*4b169a6bSchristos printf ("pass\n"); 27*4b169a6bSchristos exit (0); 28*4b169a6bSchristos } 29