diff options
author | Eric Blake <ebb9@byu.net> | 2009-10-20 16:47:36 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-10-20 21:21:52 -0600 |
commit | 8c871c07bc6a6bd7f4112053863833020569b272 (patch) | |
tree | 203e1334be1d12b52b68c1706f40e310423f850d /doc/posix-functions/futimens.texi | |
parent | 06b8c126a964a60ad353cc4f7b296060ae5c9df4 (diff) | |
download | gnulib-8c871c07bc6a6bd7f4112053863833020569b272.tar.gz |
utimensat: work around Solaris 9 bug
utimes("file/",times) mistakenly succeeds. This commit doesn't fix
utimes, but does make utimensat be careful before calling utimes.
The test is now enhanced to test trailing slashes and directories.
Meanwhile, cygwin 1.5 stat() on a directory changes atime (it does
a readdir under the hood to populate st_nlink), so only mtime of
a directory is reliable enough for testing. Cygwin 1.7 no longer
has this problem, because it no longer wastes time on st_nlink.
* lib/utimens.c (fdutimens, lutimens): Force a stat if platform
has trailing slash bugs.
* tests/test-lutimens.h (test_lutimens): Enhance test.
* tests/test-utimens.h (test_utimens): Likewise.
* doc/posix-functions/utime.texi (utime): Document the bug.
* doc/posix-functions/utimes.texi (utimes): Likewise.
* doc/posix-functions/utimensat.texi (utimensat): Likewise.
* doc/glibc-functions/futimesat.texi (futimesat): Likewise.
* doc/glibc-functions/lutimes.texi (lutimes): Mention utimens.
* doc/posix-functions/futimens.texi (futimens): Mention
limitation.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'doc/posix-functions/futimens.texi')
-rw-r--r-- | doc/posix-functions/futimens.texi | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/posix-functions/futimens.texi b/doc/posix-functions/futimens.texi index 1434033ead..fee3d087fe 100644 --- a/doc/posix-functions/futimens.texi +++ b/doc/posix-functions/futimens.texi @@ -13,6 +13,8 @@ This function is missing on some platforms: glibc 2.3.6, MacOS X 10.3, FreeBSD 6.0, NetBSD 3.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x, mingw, Interix 3.5, BeOS. +However, the replacement function may end up truncating timestamps to +less resolution than supported by the file system. @item This function returns a bogus value instead of failing with @code{ENOSYS} on some platforms: @@ -29,5 +31,10 @@ Portability problems not fixed by Gnulib: @item Some platforms lack the ability to change the timestamps of a file descriptor, so the replacement can fail with @code{ENOSYS}; the gnulib -module @samp{utimens} provides a more reliable interface @code{gl_futimens}. +module @samp{utimens} provides a more reliable interface @code{fdutimens}. +@item +The mere act of using @code{stat} modifies the access time of +directories on some platforms, so @code{utimensat} can only +effectively change directory modification time: +Cygwin 1.5.x. @end itemize |