refresh_wall(void)
{
time_init();
- clock_gettime(CLOCK_REALTIME, &wall_time);
+ xclock_gettime(CLOCK_REALTIME, &wall_time);
wall_tick = false;
}
if (!time_stopped) {
if (monotonic_clock == CLOCK_MONOTONIC) {
- clock_gettime(monotonic_clock, &monotonic_time);
+ xclock_gettime(monotonic_clock, &monotonic_time);
} else {
refresh_wall_if_ticked();
monotonic_time = wall_time;
}
}
+void
+xclock_gettime(clock_t id, struct timespec *ts)
+{
+ if (clock_gettime(id, ts) == -1) {
+ /* It seems like a bad idea to try to use vlog here because it is
+ * likely to try to check the current time. */
+ ovs_abort(errno, "xclock_gettime() failed");
+ }
+}
+
static long long int
timeval_diff_msec(const struct timeval *a, const struct timeval *b)
{
long long int timeval_to_msec(const struct timeval *);
void xgettimeofday(struct timeval *);
+void xclock_gettime(clock_t, struct timespec *);
int get_cpu_usage(void);
void format_backtraces(struct ds *, size_t min_count);