2 @section @code{utimensat}
5 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimensat.html}
7 Gnulib module: utimensat
9 Portability problems fixed by Gnulib:
12 This function is missing on some platforms:
13 glibc 2.5, Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 10, Cygwin 1.5.x, mingw, MSVC 14, Android 3.0.
14 However, the replacement function may end up truncating timestamps to
15 worse resolution than supported by the file system. Furthermore, the
16 replacement function is not safe to be used in libraries and is not
19 This function returns a bogus value instead of failing with
20 @code{ENOSYS} on some platforms:
23 This function fails with @code{ENOSYS} if passed the flag
24 @code{AT_SYMLINK_NOFOLLOW} on a regular file:
27 When using @code{UTIME_OMIT} or @code{UTIME_NOW}, some systems require
28 the @code{tv_sec} argument to be 0, and don't necessarily handle all
29 file permissions in the manner required by POSIX:
32 When using @code{UTIME_OMIT} for the modification time, but specifying
33 an access time, some systems fail to update the change time:
34 Linux kernel 2.6.32, Mac OS X 10.13, NetBSD 9.0, Solaris 11.1.
36 Out-of-range values of @code{tv_nsec} do not lead to a failure on some
38 Linux kernel 2.6.22.19 on hppa.
41 Portability problems not fixed by Gnulib:
44 On some platforms, timestamps of symbolic links cannot be modified, so
45 the replacement fails with @code{ENOSYS} if passed the flag
46 @code{AT_SYMLINK_NOFOLLOW} on a symlink.
48 The mere act of using @code{lstat} modifies the access time of
49 symlinks on some platforms, so @code{utimensat} with
50 @code{AT_SYMLINK_NOFOLLOW} can only effectively change modification time:
53 The mere act of using @code{stat} modifies the access time of
54 directories on some platforms, so @code{utimensat} can only
55 effectively change directory modification time:
59 The gnulib module @code{fdutimensat} provides a similar interface.