OpenCoverage

timespec.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/timespec.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10enum { TIMESPEC_RESOLUTION = 1000000000 };-
11enum { LOG10_TIMESPEC_RESOLUTION = 9 };-
12-
13-
14-
15inline struct timespec-
16make_timespec (time_t s, long int ns)-
17{-
18 struct timespec r;-
19 r.tv_sec = s;-
20 r.tv_nsec = ns;-
21 return
executed 602 times by 3 tests: return r;
Executed by:
  • sleep
  • tail
  • timeout
r;
executed 602 times by 3 tests: return r;
Executed by:
  • sleep
  • tail
  • timeout
602
22}-
23inline int __attribute__ ((__pure__))-
24timespec_cmp (struct timespec a, struct timespec b)-
25{-
26 if (a.tv_sec < b.tv_sec
a.tv_sec < b.tv_secDescription
TRUEevaluated 3972 times by 3 tests
Evaluated by:
  • du
  • ls
  • vdir
FALSEevaluated 425601 times by 4 tests
Evaluated by:
  • du
  • ls
  • tail
  • vdir
)
3972-425601
27 return
executed 3972 times by 3 tests: return -1;
Executed by:
  • du
  • ls
  • vdir
-1;
executed 3972 times by 3 tests: return -1;
Executed by:
  • du
  • ls
  • vdir
3972
28 if (a.tv_sec > b.tv_sec
a.tv_sec > b.tv_secDescription
TRUEevaluated 197403 times by 3 tests
Evaluated by:
  • du
  • ls
  • vdir
FALSEevaluated 228198 times by 4 tests
Evaluated by:
  • du
  • ls
  • tail
  • vdir
)
197403-228198
29 return
executed 197403 times by 3 tests: return 1;
Executed by:
  • du
  • ls
  • vdir
1;
executed 197403 times by 3 tests: return 1;
Executed by:
  • du
  • ls
  • vdir
197403
30-
31-
32-
33 ((-1 <= a.tv_nsec && a.tv_nsec <= 2 * TIMESPEC_RESOLUTION) ? (void) 0 : __builtin_unreachable ());-
34 ((-1 <= b.tv_nsec && b.tv_nsec <= 2 * TIMESPEC_RESOLUTION) ? (void) 0 : __builtin_unreachable ());-
35-
36 return
executed 228198 times by 4 tests: return a.tv_nsec - b.tv_nsec;
Executed by:
  • du
  • ls
  • tail
  • vdir
a.tv_nsec - b.tv_nsec;
executed 228198 times by 4 tests: return a.tv_nsec - b.tv_nsec;
Executed by:
  • du
  • ls
  • tail
  • vdir
228198
37}-
38-
39-
40-
41inline int __attribute__ ((__pure__))-
42timespec_sign (struct timespec a)-
43{-
44 return
never executed: return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
never executed: return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
0
45}-
46-
47struct timespec timespec_add (struct timespec, struct timespec)-
48 __attribute__ ((__const__));-
49struct timespec timespec_sub (struct timespec, struct timespec)-
50 __attribute__ ((__const__));-
51struct timespec dtotimespec (double)-
52 __attribute__ ((__const__));-
53-
54-
55inline double-
56timespectod (struct timespec a)-
57{-
58 return
never executed: return a.tv_sec + a.tv_nsec / 1e9;
a.tv_sec + a.tv_nsec / 1e9;
never executed: return a.tv_sec + a.tv_nsec / 1e9;
0
59}-
60-
61void gettime (struct timespec *);-
62int settime (struct timespec const *);-
63-
64-
65-
66-
67-
68-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2