+2009-10-12 Eric Blake <ebb9@byu.net>
+
+ sys_stat: guarantee struct timespec
+ * lib/sys_stat.in.h (includes): Always include <time.h>
+ * modules/sys_stat (Depends-on): Add time.
+ * tests/test-sys_stat.c: Guarantee struct timespec, as well as
+ mode_t permission values.
+ * doc/posix-headers/sys_stat.texi (sys/stat.h): Document how to
+ get at subsecond timestamps.
+
2009-10-10 Eric Blake <ebb9@byu.net>
futimens: new module
@item
The macros @code{UTIME_NOW} and @code{UTIME_OMIT} are missing on some
platforms.
+@item
+On some platforms, @code{struct stat} does not include @code{st_atim},
+@code{st_mtim}, or @code{st_ctim} members. Use the gnulib module
+@samp{stat-time} for accessors to portably get at subsecond resolution.
@end itemize
Portability problems not fixed by Gnulib:
/* Get nlink_t. */
#include <sys/types.h>
+/* Get struct timespec. */
+#include <time.h>
+
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
verify (!S_ISWHT (S_IFSOCK));
#endif
+/* POSIX 2008 requires traditional encoding of permission constants. */
+verify (S_IRWXU == 00700);
+verify (S_IRUSR == 00400);
+verify (S_IWUSR == 00200);
+verify (S_IXUSR == 00100);
+verify (S_IRWXG == 00070);
+verify (S_IRGRP == 00040);
+verify (S_IWGRP == 00020);
+verify (S_IXGRP == 00010);
+verify (S_IRWXO == 00007);
+verify (S_IROTH == 00004);
+verify (S_IWOTH == 00002);
+verify (S_IXOTH == 00001);
+verify (S_ISUID == 04000);
+verify (S_ISGID == 02000);
+verify (S_ISVTX == 01000);
+
#if ((0 <= UTIME_NOW && UTIME_NOW < 1000000000) \
|| (0 <= UTIME_OMIT && UTIME_OMIT < 1000000000) \
|| UTIME_NOW == UTIME_OMIT)
/* Check the existence of some types. */
nlink_t t1;
+struct timespec t2;
+
int
main ()
{