xref: /netbsd-src/external/gpl3/gdb/dist/sim/testsuite/cris/c/sched3.c (revision 4b169a6ba595ae283ca507b26b15fdff40495b1c)
1 /*
2 #progos: linux
3 */
4 
5 #include <sched.h>
6 #include <stdio.h>
7 #include <errno.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10 
main(void)11 int main (void)
12 {
13   struct sched_param sb;
14   sb.sched_priority = 0;
15   if (sched_setscheduler (getpid (), SCHED_OTHER, &sb) != 0
16       || sb.sched_priority != 0)
17     abort ();
18   sb.sched_priority = 5;
19   if (sched_setscheduler (getpid (), SCHED_OTHER, &sb) != -1
20       || errno != EINVAL
21       || sb.sched_priority != 5)
22     abort ();
23   printf ("pass\n");
24   exit (0);
25 }
26