summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-03-01 15:21:38 -0800
committerBrian Behlendorf <[email protected]>2011-03-02 11:34:43 -0800
commita4a1e1ecb42c3a0d9a25b5b0e0b400147b91bdb3 (patch)
treebee6000ae863ddc99648e39011df8e70325c4250 /include/sys
parent19c1eb829d014cc64a5742710dae042bdaef25ae (diff)
Add TIMESPEC_OVERFLOW helper
Add the TIMESPEC_OVERFLOW helper macro to allow easy checking of timespec overflow.
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/time.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sys/time.h b/include/sys/time.h
index e4470a491..ed3aae934 100644
--- a/include/sys/time.h
+++ b/include/sys/time.h
@@ -82,4 +82,7 @@ gethrestime_sec(void)
return now.tv_sec;
}
+#define TIMESPEC_OVERFLOW(ts) \
+ ((ts)->tv_sec < TIME32_MIN || (ts)->tv_sec > TIME32_MAX)
+
#endif /* _SPL_TIME_H */