poll tests: Avoid test failure on BSD and Solaris systems.
[gnulib.git] / doc / posix-functions / utimes.texi
blob5505906662e17f1f3d8df97db1dee65f49c41e18
1 @node utimes
2 @section @code{utimes}
3 @findex utimes
5 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/utimes.html}
7 Gnulib module: ---
9 Portability problems fixed by Gnulib:
10 @itemize
11 @end itemize
13 Portability problems not fixed by Gnulib:
14 @itemize
15 @item
16 This function is missing on some platforms:
17 Minix 3.1.8, mingw, MSVC 14.
18 @item
19 On some platforms, this function mis-handles trailing slash:
20 FreeBSD 7.2, Solaris 9.
21 @item
22 This function cannot set full timestamp resolution.  In particular,
23 some platforms incorrectly round rather than truncate.  Use
24 @code{utimensat(AT_FDCWD,file,times,0)}, or the gnulib module @code{utimens},
25 instead.
26 @item
27 On some platforms, @code{utimes (file, NULL)} fails to set the
28 file's timestamp to the current time:
29 glibc 2.3.3.
30 @item
31 On some platforms, @code{utimes} failed on read-only files when
32 @code{utime} worked fine.
33 glibc 2.2.5.
34 @item
35 On OS/2, this function cannot set the timestamp to earlier than the
36 year 1980 in local time.
37 @item
38 On OS/2, this function cannot set the timestamp to an odd number of
39 seconds.
40 @item
41 On OS/2, this function does not work on an opened file.
42 @end itemize
44 Extension: Gnulib provides a module @samp{utimens} that works around these
45 problems and allows to set the time with nanosecond resolution (as far as
46 supported by the file system).