+/* Same as time_now() except does not write to static variables, for use in
+ * signal handlers. */
+static time_t
+time_now_sig(void)
+{
+ struct timespec cur_time;
+
+ clock_gettime(monotonic_clock, &cur_time);
+ return cur_time.tv_sec;
+}
+
+/* Returns the current time, in seconds. */
+time_t
+time_wall(void)
+{
+ refresh_wall_if_ticked();
+ return wall_time.tv_sec;
+}
+
+/* Returns a monotonic timer, in ms (within TIME_UPDATE_INTERVAL ms). */