Debian Codegraph @

testsuite/systemtap.syscall/nice.c

raw
1 /* COVERAGE: nice */
2
3 #define _GNU_SOURCE
4 #include <unistd.h>
5 #include <sys/syscall.h>
6
7 #ifdef __NR_nice
8 int __nice(int inc)
9 {
10 /* glibc wrapper sysdeps/posix/nice.c uses get/setpriority
11 * syscalls so we do need syscall() here */
12 return syscall(__NR_nice, inc);
13 }
14
15 int main()
16 {
17 __nice(1);
18 //staptest// nice (1) = NNNN
19
20 __nice(0);
21 //staptest// nice (0) = NNNN
22
23 __nice(-1);
24 //staptest// nice (-1) = NNNN
25
26 return 0;
27 }
28 #else
29 int main()
30 {
31 return 0;
32 }
33 #endif