+2021-12-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ 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.
+
2021-12-28 Bruno Haible <bruno@clisp.org>
gen-uni-tables: Produce license notices suitable for Gnulib.
{
#if defined CLOCK_REALTIME && HAVE_CLOCK_GETTIME
clock_gettime (CLOCK_REALTIME, ts);
+#elif defined HAVE_TIMESPEC_GET
+ timespec_get (ts, TIME_UTC);
#else
struct timeval tv;
gettimeofday (&tv, NULL);
-# 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,
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])
])