776f5a5937e945e69468066ef3eeda5f08103ae7
[gnulib.git] / doc / posix-functions / utimensat.texi
1 @node utimensat
2 @section @code{utimensat}
3 @findex utimensat
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/utimensat.html}
6
7 Gnulib module: utimensat
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 This function is missing on some platforms:
13 glibc 2.3.6, Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8,
14 AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, MSVC 9,
15 Interix 3.5, BeOS.
16 However, the replacement function may end up truncating timestamps to
17 less resolution than supported by the file system.  Furthermore, the
18 replacement function is not safe to be used in libraries and is not
19 multithread-safe.
20 @item
21 This function returns a bogus value instead of failing with
22 @code{ENOSYS} on some platforms:
23 Linux kernel 2.6.21.
24 @item
25 This function fails with @code{ENOSYS} if passed the flag
26 @code{AT_SYMLINK_NOFOLLOW} on a regular file:
27 Linux kernel 2.6.22.
28 @item
29 When using @code{UTIME_OMIT} or @code{UTIME_NOW}, some systems require
30 the @code{tv_sec} argument to be 0, and don't necessarily handle all
31 file permissions in the manner required by POSIX:
32 Linux kernel 2.6.25.
33 @item
34 When using @code{UTIME_OMIT} for the modification time, but specifying
35 an access time, some systems fail to update the change time:
36 Linux kernel 2.6.32.
37 @item
38 Out-of-range values of @code{tv_nsec} do not lead to a failure on some
39 platforms:
40 Linux kernel 2.6.22.19 on hppa.
41 @end itemize
42
43 Portability problems not fixed by Gnulib:
44 @itemize
45 @item
46 On some platforms, timestamps of symbolic links cannot be modified, so
47 the replacement fails with @code{ENOSYS} if passed the flag
48 @code{AT_SYMLINK_NOFOLLOW} on a symlink.
49 @item
50 The mere act of using @code{lstat} modifies the access time of
51 symlinks on some platforms, so @code{utimensat} with
52 @code{AT_SYMLINK_NOFOLLOW} can only effectively change modification time:
53 Cygwin.
54 @item
55 The mere act of using @code{stat} modifies the access time of
56 directories on some platforms, so @code{utimensat} can only
57 effectively change directory modification time:
58 Cygwin 1.5.x.
59 @end itemize
60
61 The gnulib module fdutimensat provides a similar interface.