1 #include "tests.h"
2 #include <asm/unistd.h>
3 
4 #if defined __NR_sched_getparam && defined __NR_sched_setparam
5 
6 # include <sched.h>
7 # include <stdio.h>
8 # include <unistd.h>
9 
10 int
11 main(void)
12 {
13 	struct sched_param *const param =
14 		tail_alloc(sizeof(struct sched_param));
15 
16 	long rc = syscall(__NR_sched_getparam, 0, param);
17 	printf("sched_getparam(0, [%d]) = %ld\n",
18 	       param->sched_priority, rc);
19 
20 	param->sched_priority = -1;
21 	rc = syscall(__NR_sched_setparam, 0, param);
22 	printf("sched_setparam(0, [%d]) = %ld %s (%m)\n",
23 	       param->sched_priority, rc, errno2name());
24 
25 	puts("+++ exited with 0 +++");
26 	return 0;
27 }
28 
29 #else
30 
31 SKIP_MAIN_UNDEFINED("__NR_sched_getparam && __NR_sched_setparam")
32 
33 #endif
34