These macros are private to stat-time.h. */
#if defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
-# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim)
+# ifdef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
+# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim)
+# else
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec)
+# endif
#elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec)
#elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC
#endif
}
-/* Set *ST's access time. */
-static inline void
-set_stat_atime (struct stat *st, struct timespec t)
-{
-#ifdef STAT_TIMESPEC
- STAT_TIMESPEC (st, st_atim) = t;
-#else
- st->st_atime = t.tv_sec;
-# if defined STAT_TIMESPEC_NS
- STAT_TIMESPEC_NS (st, st_atim) = t.tv_nsec;
-# elif defined HAVE_STRUCT_STAT_ST_SPARE1
- st->st_spare1 = t.tv_nsec / 1000;
-# endif
-#endif
-}
-
-/* Set *ST's status change time. */
-static inline void
-set_stat_ctime (struct stat *st, struct timespec t)
-{
-#ifdef STAT_TIMESPEC
- STAT_TIMESPEC (st, st_ctim) = t;
-#else
- st->st_ctime = t.tv_sec;
-# if defined STAT_TIMESPEC_NS
- STAT_TIMESPEC_NS (st, st_ctim) = t.tv_nsec;
-# elif defined HAVE_STRUCT_STAT_ST_SPARE1
- st->st_spare1 = t.tv_nsec / 1000;
-# endif
-#endif
-}
-
-/* Set *ST's data modification time. */
-static inline void
-set_stat_mtime (struct stat *st, struct timespec t)
-{
-#ifdef STAT_TIMESPEC
- STAT_TIMESPEC (st, st_mtim) = t;
-#else
- st->st_mtime = t.tv_sec;
-# if defined STAT_TIMESPEC_NS
- STAT_TIMESPEC_NS (st, st_mtim) = t.tv_nsec;
-# elif defined HAVE_STRUCT_STAT_ST_SPARE1
- st->st_spare1 = t.tv_nsec / 1000;
-# endif
-#endif
-}
-
#endif