mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-27 12:17:12 +09:00
glibc needs -lrt to get clock_gettime()
Reported by csosstudy
This commit is contained in:
@@ -153,6 +153,8 @@ AC_C_BIGENDIAN
|
||||
|
||||
dnl Checks for functions and headers
|
||||
|
||||
AC_CHECK_FUNC(clock_gettime, , [AC_CHECK_LIB(rt, clock_gettime)])
|
||||
|
||||
AC_CHECK_FUNCS([SecureZeroMemory])
|
||||
|
||||
dnl Switches.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
long long nanoseconds(void)
|
||||
{
|
||||
#ifdef CLOCK_REALTIME
|
||||
#if defined(CLOCK_REALTIME) && defined(HAVE_CLOCK_GETTIME)
|
||||
struct timespec t;
|
||||
if (clock_gettime(CLOCK_REALTIME,&t) != 0) return -1;
|
||||
return t.tv_sec * 1000000000LL + t.tv_nsec;
|
||||
|
||||
Reference in New Issue
Block a user