glibc needs -lrt to get clock_gettime()
Reported by csosstudy
This commit is contained in:
parent
c6fa04725f
commit
37a1358b81
@ -153,6 +153,8 @@ AC_C_BIGENDIAN
|
|||||||
|
|
||||||
dnl Checks for functions and headers
|
dnl Checks for functions and headers
|
||||||
|
|
||||||
|
AC_CHECK_FUNC(clock_gettime, , [AC_CHECK_LIB(rt, clock_gettime)])
|
||||||
|
|
||||||
AC_CHECK_FUNCS([SecureZeroMemory])
|
AC_CHECK_FUNCS([SecureZeroMemory])
|
||||||
|
|
||||||
dnl Switches.
|
dnl Switches.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
long long nanoseconds(void)
|
long long nanoseconds(void)
|
||||||
{
|
{
|
||||||
#ifdef CLOCK_REALTIME
|
#if defined(CLOCK_REALTIME) && defined(HAVE_CLOCK_GETTIME)
|
||||||
struct timespec t;
|
struct timespec t;
|
||||||
if (clock_gettime(CLOCK_REALTIME,&t) != 0) return -1;
|
if (clock_gettime(CLOCK_REALTIME,&t) != 0) return -1;
|
||||||
return t.tv_sec * 1000000000LL + t.tv_nsec;
|
return t.tv_sec * 1000000000LL + t.tv_nsec;
|
||||||
|
Loading…
Reference in New Issue
Block a user