utimens: add lutimens interface
authorEric Blake <ebb9@byu.net>
Wed, 7 Oct 2009 19:36:45 +0000 (13:36 -0600)
committerEric Blake <ebb9@byu.net>
Sat, 10 Oct 2009 14:29:53 +0000 (08:29 -0600)
commit2726b8f439601389d4e01839982d3a01cd51849d
tree3f9c969a665e0f2b218ed050e9a0e8c97054376b
parentd71f50566b9f00d9a325a08dff406f52d3f42195
utimens: add lutimens interface

Wraps utimensat(,AT_SYMLINK_NOFOLLOW) or lutimes, when supported;
otherwise fail with ENOSYS.  Allows coreutils' copy.c to preserve
symlink timestamps on more systems.  Note that cygwin's lstat
changes atime of symlinks, but mtime can reliably be set.

* lib/utimens.c (lutimens): New function.
* m4/utimens.m4 (gl_UTIMENS): Check for lutimes.
* lib/utimens.h (lutimens): Declare new interface.
* tests/test-utimens.c (main): Enhance test.
* tests/test-lutimens.h (test_lutimens): New file.
* modules/utimens-tests (Files): Distribute it.
(Depends-on): Add symlink.
(configure.ac): Check for usleep.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/utimens.c
lib/utimens.h
m4/utimens.m4
modules/utimens-tests
tests/test-lutimens.h [new file with mode: 0644]
tests/test-utimens.c