summaryrefslogtreecommitdiff
path: root/lib/utimens.h
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-10-07 13:36:45 -0600
committerEric Blake <ebb9@byu.net>2009-10-10 08:29:53 -0600
commit2726b8f439601389d4e01839982d3a01cd51849d (patch)
tree3f9c969a665e0f2b218ed050e9a0e8c97054376b /lib/utimens.h
parentd71f50566b9f00d9a325a08dff406f52d3f42195 (diff)
downloadgnulib-2726b8f439601389d4e01839982d3a01cd51849d.tar.gz
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>
Diffstat (limited to 'lib/utimens.h')
-rw-r--r--lib/utimens.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/utimens.h b/lib/utimens.h
index 169521da73..8b3ccef5eb 100644
--- a/lib/utimens.h
+++ b/lib/utimens.h
@@ -1,3 +1,4 @@
#include <time.h>
int gl_futimens (int, char const *, struct timespec const [2]);
int utimens (char const *, struct timespec const [2]);
+int lutimens (char const *, struct timespec const [2]);