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