1*4b169a6bSchristos /* 2*4b169a6bSchristos #progos: linux 3*4b169a6bSchristos */ 4*4b169a6bSchristos 5*4b169a6bSchristos #include <sched.h> 6*4b169a6bSchristos #include <stdio.h> 7*4b169a6bSchristos #include <errno.h> 8*4b169a6bSchristos #include <stdlib.h> 9*4b169a6bSchristos #include <unistd.h> 10*4b169a6bSchristos main(void)11*4b169a6bSchristosint main (void) 12*4b169a6bSchristos { 13*4b169a6bSchristos struct sched_param sb; 14*4b169a6bSchristos sb.sched_priority = 0; 15*4b169a6bSchristos if (sched_setparam (getpid (), &sb) != 0 16*4b169a6bSchristos || sb.sched_priority != 0) 17*4b169a6bSchristos abort (); 18*4b169a6bSchristos sb.sched_priority = 5; 19*4b169a6bSchristos if (sched_setparam (getpid (), &sb) == 0 20*4b169a6bSchristos || errno != EINVAL 21*4b169a6bSchristos || sb.sched_priority != 5) 22*4b169a6bSchristos abort (); 23*4b169a6bSchristos printf ("pass\n"); 24*4b169a6bSchristos exit (0); 25*4b169a6bSchristos } 26