Ping.
On Wed, May 8, 2019 at 1:52 PM Uros Bizjak <ubiz...@gmail.com> wrote: > > Hello! > > CentOS 5.11 (glibc 2.5) does not have utimensat function, so there is > no nanosecond precision of file times available. Currently, the test > fails with: > > /tmp/cc36u3o7.o: In function > `_D3std4file17__T8setTimesTAyaZ8setTimesFAyaS3std8datetime7systime7SysTimeS3std8datetime7systime7SysTimeZ16trustedUtimensatFNbNiNeiPxaKxG2S4core3sys5posix6signal8timespeciZi': > /home/uros/git/gcc/libphobos/testsuite/../src/std/file.d:1272: > undefined reference to `utimensat' > collect2: error: ld returned 1 exit status > compiler exited with status 1 > > Attached patch detects utimensat function during configure time and > falls back to utimes in case utimensat is not available. > > 2019-05-08 Uroš Bizjak <ubiz...@gmail.com> > > PR d/90261 > * m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_CLIB): > Check for utimensat function. > * configure: Regenerate > * Makefile.in: Regenerate > * libdruntime/gcc/config.d.in: Add Have_Utimensat. > * libdruntime/Makefile.in: Regenerate. > * libdruntime/core/sys/posix/sys/stat.d [version (CRuntime_Glibc)]: > Declare utimensat and futimens only with Have_Utimensat. > * src/Makefile.in: Regenerate. > * src/std/file.d: Call testTimes with non-zero argument only > when utimensat is defined. > * testsuite/Makefile.in: Regenerate. > > BTW: The same fix as applied to CRuntime_Glibc can also be applied to > FreeBSD version, which currently reads: > > // Since FreeBSD 11: > version (none) > { > int utimensat(int dirfd, const char *pathname, > ref const(timespec)[2] times, int flags); > int futimens(int fd, ref const(timespec)[2] times); > } > > BTW2: The testcase now fails in another place in src/std/file.d on > CentOS 5.11 (and probably other non-modern systems): > > // Tests sub-second precision of querying file times. > // Should pass on most modern systems running on modern filesystems. > // Exceptions: > // - FreeBSD, where one would need to first set the > // vfs.timestamp_precision sysctl to a value greater than zero. > // - OS X, where the native filesystem (HFS+) stores filesystem > // timestamps with 1-second precision. > > This test should check the availability of utimensat on linux, > otherwise the resolution is only in seconds range. > > Patch was bootstrapped and regression tested on x86_64-linux-gnu > {,-m32} with CentOS 5.11 and Fedora 30. > > Uros.