utimensat: work around Solaris 9 bug
[pspp] / 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, MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX
14 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw,
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 When using @code{UTIME_OMIT} or @code{UTIME_NOW}, some systems require
26 the @code{tv_sec} argument to be 0, and don't necessarily handle all
27 file permissions in the manner required by POSIX:
28 Linux kernel 2.6.25.
29 @end itemize
30
31 Portability problems not fixed by Gnulib:
32 @itemize
33 @item
34 On some platforms, timestamps of symbolic links cannot be modified, so
35 the replacement fails with @code{ENOSYS} if passed the flag
36 @code{AT_SYMLINK_NOFOLLOW} on a symlink.
37 @item
38 The mere act of using @code{lstat} modifies the access time of
39 symlinks on some platforms, so @code{utimensat} with
40 @code{AT_SYMLINK_NOFOLLOW} can only effectively change modification time:
41 Cygwin.
42 @item
43 The mere act of using @code{stat} modifies the access time of
44 directories on some platforms, so @code{utimensat} can only
45 effectively change directory modification time:
46 Cygwin 1.5.x.
47 @end itemize
48
49 The gnulib module fdutimensat provides a similar interface.