From: David Quigley Date: Thu, 5 May 2016 23:10:46 +0000 (-0400) Subject: Add a macro to convert seconds to nanoseconds and vice-versa X-Git-Tag: spl-0.7.0-rc1~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e39e4f0b26551769e0cfc50987cbb8cdef5fbcf;p=spl Add a macro to convert seconds to nanoseconds and vice-versa Required infrastructure for zfsonlinux/zfs#4600. Signed-off-by: Brian Behlendorf Closes #546 --- 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) \