+2021-01-05 Bruno Haible <bruno@clisp.org>
+
+ utimens, utimensat, fdutimensat: Avoid test failures on AIX 7.2.
+ * lib/utimecmp.c (utimecmpat): On AIX, declare equality when the two
+ times differ by less than 0.01 seconds.
+ * tests/test-futimens.h (test_futimens): Pass UTIMECMP_TRUNCATE_SOURCE
+ flag.
+
2021-01-05 Bruno Haible <bruno@clisp.org>
utimensat: Work around trailing slash bug in utimensat() on AIX 7.2.
if (options & UTIMECMP_TRUNCATE_SOURCE)
{
+#if defined _AIX
+ /* On AIX 7.2, on a jfs2 file system, the times may differ by up to
+ 0.01 seconds in either direction. But it does not seem to come
+ from clock ticks of 0.01 seconds each. */
+ long long difference =
+ ((long long) dst_s - (long long) src_s) * BILLION
+ + ((long long) dst_ns - (long long) src_ns);
+ if (difference < 10000000 && difference > -10000000)
+ return 0;
+#endif
+
/* Look up the timestamp resolution for the destination device. */
/* Hash table for caching information learned about devices. */
ASSERT (st3.st_atime == Y2K);
ASSERT (0 <= get_stat_atime_ns (&st3));
ASSERT (get_stat_atime_ns (&st3) <= BILLION / 2);
- ASSERT (utimecmp (BASE "file", &st1, &st3, 0) <= 0);
+ ASSERT (utimecmp (BASE "file", &st1, &st3, UTIMECMP_TRUNCATE_SOURCE) <= 0);
if (check_ctime)
ASSERT (ctime_compare (&st2, &st3) < 0);
nap ();