Debian Codegraph @

testsuite/systemtap.syscall/adjtimex.c

raw
1 /* COVERAGE: adjtimex */
2
3 #define _GNU_SOURCE
4 #include <unistd.h>
5 #include <string.h>
6 #include <sys/timex.h>
7 #include <sys/syscall.h>
8
9 int main()
10 {
11 static struct timex ts;
12
13 memset(&ts, 0, sizeof(ts));
14 ts.modes = ADJ_STATUS;
15 adjtimex(&ts);
16 //staptest// [[[[adjtimex (!!!!clock_adjtime (CLOCK_REALTIME, ]]]]\{ADJ_STATUS, constant=0, esterror=0, freq=0, maxerror=0, offset=NNNN, precision=0, status=0, tick=NNNN, tolerance=0\}) = NNNN
17
18 // The glibc wrapper would SEGV in the following case, so we resort to
19 // direct syscall invocation
20 syscall(__NR_adjtimex, (struct timex *)-1);
21 #ifdef __s390__
22 //staptest// adjtimex (0x[7]?[f]+) = NNNN
23 #else
24 //staptest// adjtimex (0x[f]+) = NNNN
25 #endif
26
27 return 0;
28
29 }
30