#include <sys/select.h>
#include <sys/ioctl.h>
-#ifndef HAVE_CLOCK_GETTIME
-#include "compat/clock_gettime.h"
-#endif
-
#include "heritage.h"
#include "shmlog.h"
#include "cache.h"
static MTX vbemtx;
-/*--------------------------------------------------------------------*/
-/* XXX: belongs a more general place */
-
-static double
-Uptime(void)
-{
- struct timespec ts;
-
- assert(clock_gettime(CLOCK_MONOTONIC, &ts) == 0);
- return (ts.tv_sec + ts.tv_nsec * 1e-9);
-}
-
/*--------------------------------------------------------------------*/
struct bereq *
error = getaddrinfo(bp->hostname,
bp->portname == NULL ? "http" : bp->portname,
&hint, &res);
- bp->dnstime = Uptime();
+ bp->dnstime = TIM_mono();
if (error) {
if (res != NULL)
freeaddrinfo(res);
}
}
- if (bp->dnstime + bp->dnsttl >= Uptime())
+ if (bp->dnstime + bp->dnsttl >= TIM_mono())
return (-1);
/* Then do another lookup to catch DNS changes */