time.h (480B)
1 #include_next <sys/time.h> 2 #define timespeccmp(tsp, usp, cmp) \ 3 (((tsp)->tv_sec == (usp)->tv_sec) ? \ 4 ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \ 5 ((tsp)->tv_sec cmp (usp)->tv_sec)) 6 #define timespecsub(tsp, usp, vsp) \ 7 do { \ 8 (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ 9 (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ 10 if ((vsp)->tv_nsec < 0) { \ 11 (vsp)->tv_sec--; \ 12 (vsp)->tv_nsec += 1000000000L; \ 13 } \ 14 } while (0)