utimens: add UTIME_NOW and UTIME_OMIT support
authorEric Blake <ebb9@byu.net>
Wed, 7 Oct 2009 22:05:34 +0000 (16:05 -0600)
committerEric Blake <ebb9@byu.net>
Sat, 10 Oct 2009 14:32:20 +0000 (08:32 -0600)
commit080cbfcab5a4ddf2405c018aa7c7f95ac336a465
tree974f76615de76505373af87506776d2f3a253092
parent4a060c0d72bf079c873d2acb0191c64e17efc042
utimens: add UTIME_NOW and UTIME_OMIT support

These flags make it possible to implement futimens and utimensat;
they also make touch(1) more efficient, by avoiding stat or
gettime if native utimensat works.

* lib/utimens.c (validate_timespec, update_timespec): New helper
functions.
(gl_futimens, lutimens): Use them.
* modules/utimens (Depends-on): Add gettime, lstat, stat-time,
stdbool, sys_stat.
(Link): Mention resulting library dependency.
* modules/utimecmp (Link): Likewise.
* modules/utimens-tests (Depends-on): Drop stat-time, stdbool.
(Makefile.am): Pick up library dependency.
* lib/sys_stat.in.h (UTIME_NOW, UTIME_OMIT): Guarantee a
definition.
* tests/test-sys_stat.c: Test the definitions.
* doc/posix-headers/sys_stat.texi (sys/stat.h): Document this.
* NEWS: Document library dependency.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
NEWS
doc/posix-headers/sys_stat.texi
lib/sys_stat.in.h
lib/utimens.c
modules/utimecmp
modules/utimens
modules/utimens-tests
tests/test-sys_stat.c