aboutsummaryrefslogtreecommitdiff
path: root/include/sys/time.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sys/time.h')
-rw-r--r--include/sys/time.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/sys/time.h b/include/sys/time.h
new file mode 100644
index 0000000..f4f151f
--- /dev/null
+++ b/include/sys/time.h
@@ -0,0 +1,14 @@
+#include_next <sys/time.h>
+#define timespeccmp(tsp, usp, cmp) \
+ (((tsp)->tv_sec == (usp)->tv_sec) ? \
+ ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \
+ ((tsp)->tv_sec cmp (usp)->tv_sec))
+#define timespecsub(tsp, usp, vsp) \
+ do { \
+ (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \
+ (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \
+ if ((vsp)->tv_nsec < 0) { \
+ (vsp)->tv_sec--; \
+ (vsp)->tv_nsec += 1000000000L; \
+ } \
+ } while (0)