summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Quigley <[email protected]>2016-05-05 19:10:46 -0400
committerBrian Behlendorf <[email protected]>2016-05-05 16:10:46 -0700
commit5e39e4f0b26551769e0cfc50987cbb8cdef5fbcf (patch)
treec0b350e7f6bcfa6d6a3c63d34836119daddc4aac
parentea2633ad264912788428213607f8298c0aeafec4 (diff)
Add a macro to convert seconds to nanoseconds and vice-versa
Required infrastructure for zfsonlinux/zfs#4600. Signed-off-by: Brian Behlendorf <[email protected]> Closes #546
-rw-r--r--include/sys/time.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sys/time.h b/include/sys/time.h
index 650166145..611f5dd2d 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) \