]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Add TIMESPEC_OVERFLOW helper
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 1 Mar 2011 23:21:38 +0000 (15:21 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 2 Mar 2011 19:34:43 +0000 (11:34 -0800)
Add the TIMESPEC_OVERFLOW helper macro to allow easy checking
of timespec overflow.

include/sys/time.h

index e4470a491680b8593e4ecc055d62433912458508..ed3aae934c7561a884c40b69ffe1635f12e368d3 100644 (file)
@@ -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 */