poll tests: Avoid test failure on BSD and Solaris systems.
[gnulib.git] / doc / posix-functions / utimensat.texi
blob92c2b8b64fdb64cbd437d19113a82c41aac7aaa1
1 @node utimensat
2 @section @code{utimensat}
3 @findex utimensat
5 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimensat.html}
7 Gnulib module: utimensat
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
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
17 multithread-safe.
18 @item
19 This function returns a bogus value instead of failing with
20 @code{ENOSYS} on some platforms:
21 Linux kernel 2.6.21.
22 @item
23 This function fails with @code{ENOSYS} if passed the flag
24 @code{AT_SYMLINK_NOFOLLOW} on a regular file:
25 Linux kernel 2.6.22.
26 @item
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:
30 Linux kernel 2.6.25.
31 @item
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.
35 @item
36 Out-of-range values of @code{tv_nsec} do not lead to a failure on some
37 platforms:
38 Linux kernel 2.6.22.19 on hppa.
39 @end itemize
41 Portability problems not fixed by Gnulib:
42 @itemize
43 @item
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.
47 @item
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:
51 Cygwin.
52 @item
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:
56 Cygwin 1.5.x.
57 @end itemize
59 The gnulib module @code{fdutimensat} provides a similar interface.