summaryrefslogtreecommitdiff
path: root/tests/test-sys_stat.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-10-07 16:05:34 -0600
committerEric Blake <ebb9@byu.net>2009-10-10 08:32:20 -0600
commit080cbfcab5a4ddf2405c018aa7c7f95ac336a465 (patch)
tree974f76615de76505373af87506776d2f3a253092 /tests/test-sys_stat.c
parent4a060c0d72bf079c873d2acb0191c64e17efc042 (diff)
downloadgnulib-080cbfcab5a4ddf2405c018aa7c7f95ac336a465.tar.gz
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>
Diffstat (limited to 'tests/test-sys_stat.c')
-rw-r--r--tests/test-sys_stat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test-sys_stat.c b/tests/test-sys_stat.c
index 4b5eb767b7..25fe30d08f 100644
--- a/tests/test-sys_stat.c
+++ b/tests/test-sys_stat.c
@@ -1,5 +1,5 @@
/* Test of <sys/stat.h> substitute.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -253,6 +253,12 @@ verify (!S_ISWHT (S_IFLNK));
verify (!S_ISWHT (S_IFSOCK));
#endif
+#if ((0 <= UTIME_NOW && UTIME_NOW < 1000000000) \
+ || (0 <= UTIME_OMIT && UTIME_OMIT < 1000000000) \
+ || UTIME_NOW == UTIME_OMIT)
+invalid UTIME macros
+#endif
+
/* Check the existence of some types. */
nlink_t t1;