From: Brian Behlendorf Date: Tue, 1 Mar 2011 23:21:38 +0000 (-0800) Subject: Add TIMESPEC_OVERFLOW helper X-Git-Tag: zfs-0.8.0-rc1~152^2~491 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4a1e1ecb42c3a0d9a25b5b0e0b400147b91bdb3;p=zfs 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 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 */