summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-12-28 11:38:26 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-12-28 12:04:48 -0800
commit079927ae1590a7d84d95a9cc69ff7e2064166d16 (patch)
tree20ffd63f194b0ed52339f51a078d2aa74181a0c8 /m4
parente3f868cc2a78c5464080244b74f829541f2e67a5 (diff)
downloadgnulib-079927ae1590a7d84d95a9cc69ff7e2064166d16.tar.gz
gettime: port better to non-POSIX C2x
C2x requires a function timespec_get; prefer that to gettimeofday, since it has better resolution. * lib/gettime.c (gettime): Prefer timespec_get to gettimeofday. * m4/gettime.m4 (gl_GETTIME): Check for timespec_get. Omit a check for gettimeofday; not needed because the gettime module depends on the gettimeofday module.
Diffstat (limited to 'm4')
-rw-r--r--m4/gettime.m44
1 files changed, 2 insertions, 2 deletions
diff --git a/m4/gettime.m4 b/m4/gettime.m4
index de7c33046c..cb58bc8ebd 100644
--- a/m4/gettime.m4
+++ b/m4/gettime.m4
@@ -1,4 +1,4 @@
-# gettime.m4 serial 9
+# gettime.m4 serial 10
dnl Copyright (C) 2002, 2004-2006, 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,5 +9,5 @@ AC_DEFUN([gl_GETTIME],
dnl Prerequisites of lib/gettime.c.
AC_REQUIRE([gl_CLOCK_TIME])
AC_REQUIRE([gl_TIMESPEC])
- AC_CHECK_FUNCS_ONCE([gettimeofday])
+ AC_CHECK_FUNCS_ONCE([timespec_get])
])