Commit 20c74f72 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

deautocrap: Everybody have clock_gettime(2)

parent afcc3386
......@@ -93,7 +93,6 @@ _VARNISH_CHECK_PYTHON
# Check for libraries.
_VARNISH_SEARCH_LIBS(pthread, pthread_create, [thr pthread c_r])
_VARNISH_CHECK_LIB(rt, clock_gettime)
_VARNISH_CHECK_LIB(dl, dlopen)
_VARNISH_CHECK_LIB(socket, socket)
_VARNISH_CHECK_LIB(nsl, getaddrinfo)
......
......@@ -130,19 +130,13 @@ init(void)
vtim_mono
VTIM_mono(void)
{
#if defined(HAVE_CLOCK_GETTIME) && !defined(USE_GETHRTIME)
#if defined(HAVE_GETHRTIME) && defined(USE_GETHRTIME)
return (gethrtime() * 1e-9);
#else
struct timespec ts;
AZ(clock_gettime(CLOCK_MONOTONIC, &ts));
return (ts.tv_sec + 1e-9 * ts.tv_nsec);
#elif defined(HAVE_GETHRTIME)
return (gethrtime() * 1e-9);
#elif defined(__MACH__)
uint64_t mt = mach_absolute_time() - mt_base;
return (mt * mt_scale);
#else
#error Varnish needs some monotonic time source
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment