+ * struct timerel - a relative time.
+ * @ts: the actual timespec value.
+ *
+ * For example, 1 second: ts.tv_sec = 1, ts.tv_nsec = 0
+ */
+struct timerel {
+ struct timespec ts;
+};
+
+/**
+ * struct timeabs - an absolue time.
+ * @ts: the actual timespec value.
+ *
+ * For example, Midnight UTC January 1st, 1970: ts.tv_sec = 0, ts.tv_nsec = 0
+ */
+struct timeabs {
+ struct timespec ts;
+};
+
+/**
+ * struct timemono - a monotonic time.
+ * @ts: the actual timespec value.
+ *
+ * This comes from the monotonic clock (if available), so it's useful
+ * for measuring intervals as it won't change even if the system clock
+ * is moved for some reason.
+ */
+struct timemono {
+ struct timespec ts;
+};
+
+/**
+ * TIME_HAVE_MONOTONIC - defined if we really have a monotonic clock.
+ *
+ * Otherwise time_mono() just refers to time_now(). Your code might
+ * test this if you really need a monotonic clock.
+ */
+#if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC)
+#define TIME_HAVE_MONOTONIC 1
+#endif
+
+struct timespec time_check_(struct timespec in, const char *abortstr);
+
+/**
+ * timerel_check - check if a relative time is malformed.
+ * @in: the relative time to check (returned)