utimensat: work around Solaris 9 bug
authorEric Blake <ebb9@byu.net>
Tue, 20 Oct 2009 22:47:36 +0000 (16:47 -0600)
committerEric Blake <ebb9@byu.net>
Wed, 21 Oct 2009 03:21:52 +0000 (21:21 -0600)
commit8c871c07bc6a6bd7f4112053863833020569b272
tree203e1334be1d12b52b68c1706f40e310423f850d
parent06b8c126a964a60ad353cc4f7b296060ae5c9df4
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>
ChangeLog
doc/glibc-functions/futimesat.texi
doc/glibc-functions/lutimes.texi
doc/posix-functions/futimens.texi
doc/posix-functions/utime.texi
doc/posix-functions/utimensat.texi
doc/posix-functions/utimes.texi
lib/utimens.c
tests/test-lutimens.h
tests/test-utimens.h