From 5e39e4f0b26551769e0cfc50987cbb8cdef5fbcf Mon Sep 17 00:00:00 2001 From: David Quigley Date: Thu, 5 May 2016 19:10:46 -0400 Subject: [PATCH] Add a macro to convert seconds to nanoseconds and vice-versa Required infrastructure for zfsonlinux/zfs#4600. Signed-off-by: Brian Behlendorf Closes #546 --- include/sys/time.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/sys/time.h b/include/sys/time.h index 6501661..611f5dd 100644 --- a/include/sys/time.h +++ b/include/sys/time.h @@ -46,6 +46,9 @@ #define MSEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / MILLISEC)) #define NSEC2MSEC(n) ((n) / (NANOSEC / MILLISEC)) +#define NSEC2SEC(n) ((n) / (NANOSEC / SEC)) +#define SEC2NSEC(m) ((hrtime_t)(m) * (NANOSEC / SEC)) + static const int hz = HZ; #define TIMESPEC_OVERFLOW(ts) \ -- 2.39.2