diff options
author | Brian Behlendorf <[email protected]> | 2011-03-01 15:21:38 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-03-02 11:34:43 -0800 |
commit | a4a1e1ecb42c3a0d9a25b5b0e0b400147b91bdb3 (patch) | |
tree | bee6000ae863ddc99648e39011df8e70325c4250 | |
parent | 19c1eb829d014cc64a5742710dae042bdaef25ae (diff) |
Add TIMESPEC_OVERFLOW helper
Add the TIMESPEC_OVERFLOW helper macro to allow easy checking
of timespec overflow.
-rw-r--r-- | include/sys/time.h | 3 |
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 */ |