1 /* 2 * Public domain 3 * sys/time.h compatibility shim 4 */ 5 6 #include_next <sys/time.h> 7 8 #ifndef timespecsub 9 #define timespecsub(tsp, usp, vsp) \ 10 do { \ 11 (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ 12 (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ 13 if ((vsp)->tv_nsec < 0) { \ 14 (vsp)->tv_sec--; \ 15 (vsp)->tv_nsec += 1000000000L; \ 16 } \ 17 } while (0) 18 #endif 19