From a4a1e1ecb42c3a0d9a25b5b0e0b400147b91bdb3 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 1 Mar 2011 15:21:38 -0800 Subject: Add TIMESPEC_OVERFLOW helper Add the TIMESPEC_OVERFLOW helper macro to allow easy checking of timespec overflow. --- include/sys/time.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/sys') 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 */ -- cgit v1.2.3