aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/time.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libbb/time.c b/libbb/time.c
index cab0ad602..b6fcae28b 100644
--- a/libbb/time.c
+++ b/libbb/time.c
@@ -257,7 +257,14 @@ char* FAST_FUNC strftime_YYYYMMDDHHMMSS(char *buf, unsigned len, time_t *tp)
257 * typically requiring -lrt. We just skip all this mess */ 257 * typically requiring -lrt. We just skip all this mess */
258static void get_mono(struct timespec *ts) 258static void get_mono(struct timespec *ts)
259{ 259{
260#if defined(__NR_clock_gettime)
260 if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts)) 261 if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts))
262#elif __TIMESIZE == 64
263 if (syscall(__NR_clock_gettime64, CLOCK_MONOTONIC, ts))
264#else
265# error "We currently don't support architectures without " \
266 "the __NR_clock_gettime syscall and 32-bit time_t"
267#endif
261 bb_simple_error_msg_and_die("clock_gettime(MONOTONIC) failed"); 268 bb_simple_error_msg_and_die("clock_gettime(MONOTONIC) failed");
262} 269}
263unsigned long long FAST_FUNC monotonic_ns(void) 270unsigned long long FAST_FUNC monotonic_ns(void)