* time: Fix test failure on AIX 7.2
@ 2023-03-17 17:55 Bruno Haible
0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2023-03-17 17:55 UTC (permalink / raw)
To: bug-gnulib
Also on AIX 7.2, I see the 'time' test fail. Here too, for ca. 5 milliseconds
after gettimeofday() reports a new second, time(NULL) reports the previous one.
This patch fixes it.
2023-03-17 Bruno Haible <bruno@clisp.org>
time: Fix test failure on AIX 7.2.
* m4/time.m4 (gl_FUNC_TIME): Guess that it does not work on AIX.
* doc/posix-functions/time.texi: Mention the bug on AIX.
diff --git a/doc/posix-functions/time.texi b/doc/posix-functions/time.texi
index 5d7c719594..c744c63974 100644
--- a/doc/posix-functions/time.texi
+++ b/doc/posix-functions/time.texi
@@ -12,10 +12,10 @@
This function is not consistent with @code{gettimeofday} and @code{timespec_get}
on some platforms:
@c https://sourceware.org/bugzilla/show_bug.cgi?id=30200
-glibc 2.31 or newer on Linux, native Windows.
-Namely, in the first 1 to 2.5 milliseconds of every second (or, on Windows,
-in the first 5 milliseconds of every second), @code{time} returns a value
-that is one less than the @code{tv_sec} part of the return value of
+glibc 2.31 or newer on Linux, AIX 7.2, native Windows.
+Namely, in the first 1 to 2.5 milliseconds of every second (or, on AIX and
+Windows, in the first 5 milliseconds of every second), @code{time} returns
+a value that is one less than the @code{tv_sec} part of the return value of
@code{gettimeofday} or @code{timespec_get}.
@end itemize
diff --git a/m4/time.m4 b/m4/time.m4
index 504ec77f88..4c4e411736 100644
--- a/m4/time.m4
+++ b/m4/time.m4
@@ -1,4 +1,4 @@
-# time.m4 serial 2
+# time.m4 serial 3
dnl Copyright (C) 2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -16,6 +16,7 @@ AC_DEFUN([gl_FUNC_TIME]
dnl - glibc >= 2.31 with Linux. And binaries produced on glibc < 2.31
dnl need to run fine on newer glibc versions as well; therefore ignore
dnl __GLIBC_MINOR__.
+ dnl - AIX,
dnl - native Windows.
case "$host_os" in
linux*-gnu*)
@@ -30,6 +31,7 @@ AC_DEFUN([gl_FUNC_TIME]
[gl_cv_func_time_works="guessing no"],
[gl_cv_func_time_works="guessing yes"])
;;
+ aix*) gl_cv_func_time_works="guessing no";;
mingw*) gl_cv_func_time_works="guessing no";;
*) gl_cv_func_time_works="guessing yes";;
esac
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-17 17:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-17 17:55 time: Fix test failure on AIX 7.2 Bruno Haible
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).