Assume that the check for struct stat.st_mtime_nsec is enough.
Likewise, do not check for struct stat.st_{a,c}tim.tv_nsec.
* configure.ac (AC_CHECK_MEMBERS): Remove struct stat.st_atime_nsec,
struct stat.st_ctime_nsec, struct stat.st_atim.tv_nsec,
and struct stat.st_ctim.tv_nsec.
* file.c (HAVE_STRUCT_STAT_ST_ATIME_NSEC,
HAVE_STRUCT_STAT_ST_CTIME_NSEC): Remove.
* printstat.h (HAVE_STRUCT_STAT_ST_ATIME_NSEC,
HAVE_STRUCT_STAT_ST_CTIME_NSEC): Replace with
HAVE_STRUCT_STAT_ST_MTIME_NSEC.
* tests/xstatx.c: Likewise.
[#include <sys/types.h>
#include <asm/stat.h>])
+AC_CHECK_MEMBERS([struct stat.st_mtime_nsec],,,
+[#include <sys/types.h>
+#include <asm/stat.h>])
+
+AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec])
+
AC_CHECK_TYPES(m4_normalize([
struct pt_all_user_regs,
struct ia64_fpreg,
[#include <sys/types.h>
#include <linux/fcntl.h>])
-AC_CHECK_MEMBERS(m4_normalize([
- struct stat.st_atim.tv_nsec,
- struct stat.st_ctim.tv_nsec,
- struct stat.st_mtim.tv_nsec
-]))
-
AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
-AC_CHECK_MEMBERS(m4_normalize([
- struct stat.st_atime_nsec,
- struct stat.st_ctime_nsec,
- struct stat.st_mtime_nsec
-]),,, [#include <sys/types.h>
-#include <asm/stat.h>])
-
AC_CHECK_MEMBERS(m4_normalize([
siginfo_t.si_syscall,
siginfo_t.si_timerid,
#include "printstat.h"
/* all locally defined structures provide these fields */
-#undef HAVE_STRUCT_STAT_ST_ATIME_NSEC
-#define HAVE_STRUCT_STAT_ST_ATIME_NSEC 1
-#undef HAVE_STRUCT_STAT_ST_CTIME_NSEC
-#define HAVE_STRUCT_STAT_ST_CTIME_NSEC 1
#undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
#define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
tprints(", st_atime=");
tprints(sprinttime(cast ? (time_t) (int) statbuf->st_atime:
(time_t) statbuf->st_atime));
-#ifdef HAVE_STRUCT_STAT_ST_ATIME_NSEC
+#ifdef HAVE_STRUCT_STAT_ST_MTIME_NSEC
if (statbuf->st_atime_nsec)
tprintf(".%09lu", (unsigned long) statbuf->st_atime_nsec);
#endif
tprints(", st_ctime=");
tprints(sprinttime(cast ? (time_t) (int) statbuf->st_ctime:
(time_t) statbuf->st_ctime));
-#ifdef HAVE_STRUCT_STAT_ST_CTIME_NSEC
+#ifdef HAVE_STRUCT_STAT_ST_MTIME_NSEC
if (statbuf->st_ctime_nsec)
tprintf(".%09lu", (unsigned long) statbuf->st_ctime_nsec);
#endif
# define uid_t __kernel_uid_t
# include "asm_stat.h"
# if STRUCT_STAT_IS_STAT64
-# undef HAVE_STRUCT_STAT_ST_ATIME_NSEC
-# define HAVE_STRUCT_STAT_ST_ATIME_NSEC 1
-# undef HAVE_STRUCT_STAT_ST_CTIME_NSEC
-# define HAVE_STRUCT_STAT_ST_CTIME_NSEC 1
# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
# endif /* STRUCT_STAT_IS_STAT64 */
-# else
-# undef HAVE_STRUCT_STAT_ST_ATIME_NSEC
-# ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
-# define HAVE_STRUCT_STAT_ST_ATIME_NSEC 1
-# undef st_atime_nsec
-# define st_atime_nsec st_atim.tv_nsec
-# endif
+# else /* !USE_ASM_STAT */
# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
# ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
-# undef st_mtime_nsec
-# define st_mtime_nsec st_mtim.tv_nsec
-# endif
-# undef HAVE_STRUCT_STAT_ST_CTIME_NSEC
-# ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC
-# define HAVE_STRUCT_STAT_ST_CTIME_NSEC 1
+# undef st_atime_nsec
+# define st_atime_nsec st_atim.tv_nsec
# undef st_ctime_nsec
# define st_ctime_nsec st_ctim.tv_nsec
-# endif
+# undef st_mtime_nsec
+# define st_mtime_nsec st_mtim.tv_nsec
+# endif /* HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC */
# endif
static void
printf(", st_atime=");
print_time(st->st_atime);
-# ifdef HAVE_STRUCT_STAT_ST_ATIME_NSEC
+# ifdef HAVE_STRUCT_STAT_ST_MTIME_NSEC
if (st->st_atime_nsec)
printf(".%09lu", (unsigned long) st->st_atime_nsec);
# endif
# endif
printf(", st_ctime=");
print_time(st->st_ctime);
-# ifdef HAVE_STRUCT_STAT_ST_CTIME_NSEC
+# ifdef HAVE_STRUCT_STAT_ST_MTIME_NSEC
if (st->st_ctime_nsec)
printf(".%09lu", (unsigned long) st->st_ctime_nsec);
# endif