From: Brian Behlendorf Date: Tue, 1 Mar 2011 23:21:38 +0000 (-0800) Subject: Add TIMESPEC_OVERFLOW helper X-Git-Tag: spl-0.6.0-rc2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4a1e1ecb42c3a0d9a25b5b0e0b400147b91bdb3;p=spl Add TIMESPEC_OVERFLOW helper Add the TIMESPEC_OVERFLOW helper macro to allow easy checking of timespec overflow. --- diff --git a/include/sys/time.h b/include/sys/time.h index e4470a4..ed3aae9 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 */