diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-28 11:38:26 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-28 12:04:48 -0800 |
commit | 079927ae1590a7d84d95a9cc69ff7e2064166d16 (patch) | |
tree | 20ffd63f194b0ed52339f51a078d2aa74181a0c8 /m4 | |
parent | e3f868cc2a78c5464080244b74f829541f2e67a5 (diff) | |
download | gnulib-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.m4 | 4 |
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]) ]) |