From a710891659202c82545e84725d4e5cd77aef567c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 2 Jun 2013 08:18:31 +1000 Subject: - (dtucker) [configure.ac misc.c] Look for clock_gettime in librt and fall back to time(NULL) if we can't find it anywhere. --- misc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'misc.c') diff --git a/misc.c b/misc.c index cd45e9ecc..fd745444e 100644 --- a/misc.c +++ b/misc.c @@ -857,12 +857,16 @@ ms_to_timeval(struct timeval *tv, int ms) time_t monotime(void) { +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) fatal("clock_gettime: %s", strerror(errno)); return (ts.tv_sec); +#else + return time(NULL); +#endif } void -- cgit v1.2.3