On macOS 10.13, I'm seeing test failures: FAIL: test-futimens =================== ../../gltests/test-futimens.h:170: assertion 'ctime_compare (&st3, &st2) < 0' failed FAIL test-futimens (exit status: 134) FAIL: test-utimens ================== ../../gltests/test-utimens.h:149: assertion 'ctime_compare (&st3, &st2) < 0' failed FAIL test-utimens (exit status: 134) I looked at the file timestamps using coreutils' 'stat' program. These two failures are apparently caused by st_ctime being unchanged when you ask for an st_atime change using utimensat(). I think this is not worth working around, because every read access on a file causes st_atime to change without st_ctime changing. Another test failure, then: ./test-utimens.h:164: assertion 'func (BASE "link/", NULL) == -1' failed Abort trap: 6 2021-01-02 Bruno Haible utimens: Fix test failure on macOS 10.13. * lib/utimens.c (fdutimens): Before calling utimensat, recognize a filename ending in a slash that does not point to a directory. 2021-01-02 Bruno Haible utimens: Avoid test failures on macOS 10.13. Reported by Martin Storsjö in . * tests/test-utimens-common.h (check_ctime): Define to -1 on macOS. * tests/test-utimens.h (test_utimens): Don't expect a ctime change when only the atime is requested to change. * tests/test-futimens.h (test_futimens): Likewise. * tests/test-lutimens.h (test_lutimens): Likewise.