1 #include "tests.h"
2 #include <asm/unistd.h>
3
4 #if defined __NR_getpriority && defined __NR_setpriority
5
6 # include <stdio.h>
7 # include <sys/resource.h>
8 # include <unistd.h>
9
10 int
main(void)11 main(void)
12 {
13 const int pid = getpid();
14 long rc = syscall(__NR_getpriority, PRIO_PROCESS,
15 F8ILL_KULONG_MASK | pid);
16 printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc);
17
18 rc = syscall(__NR_setpriority, PRIO_PROCESS,
19 F8ILL_KULONG_MASK | pid, F8ILL_KULONG_MASK);
20 printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc));
21
22 puts("+++ exited with 0 +++");
23 return 0;
24 }
25
26 #else
27
28 SKIP_MAIN_UNDEFINED("__NR_getpriority && _NR_setpriority")
29
30 #endif
31