#include <stdio.h>
#include <inttypes.h>
#include <sys/time.h>
+#include <stdbool.h>
typedef uint64_t usec_t;
typedef uint64_t nsec_t;
return r;
}
+static inline bool is_timespecset(const struct timespec *t)
+{
+ return t->tv_sec || t->tv_nsec;
+}
+
#endif /* UTIL_LINUX_TIME_UTIL_H */
#include "xalloc.h"
#include "nls.h"
#include "libsmartcols.h"
+#include "timeutils.h"
#include "lsfd.h"
}
}
-static bool is_zero_timespec(const struct timespec *t)
-{
- return !t->tv_sec && !t->tv_nsec;
-}
-
static const char *anon_timerfd_decode_clockid(int clockid)
{
switch (clockid) {
clockid_name = anon_timerfd_decode_clockid(data->clockid);
exp = &data->itimerspec.it_value;
- if (!is_zero_timespec(exp))
+ if (is_timespecset(exp))
anon_timerfd_render_timespec_string(exp_buf, sizeof(exp_buf),
" remaining=", exp);
ival = &data->itimerspec.it_interval;
- if (!is_zero_timespec(ival))
+ if (is_timespecset(ival))
anon_timerfd_render_timespec_string(ival_buf, sizeof(ival_buf),
" interval=", ival);