stat.h: use POSIX-required timefields throughout

...except in certain SysV R4 cases for backward compat.
This is probably not required anymore, but it doesn't hurt
to keep it in.
This commit is contained in:
Corinna Vinschen 2019-08-16 10:52:17 +02:00
parent 91172ce591
commit 72ff9acad2

View File

@ -34,33 +34,23 @@ struct stat
gid_t st_gid; gid_t st_gid;
dev_t st_rdev; dev_t st_rdev;
off_t st_size; off_t st_size;
#if defined(__rtems__)
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
blksize_t st_blksize;
blkcnt_t st_blocks;
#else
/* SysV/sco doesn't have the rest... But Solaris, eabi does. */
#if defined(__svr4__) && !defined(__PPC__) && !defined(__sun__) #if defined(__svr4__) && !defined(__PPC__) && !defined(__sun__)
time_t st_atime; time_t st_atime;
time_t st_mtime; time_t st_mtime;
time_t st_ctime; time_t st_ctime;
#else #else
time_t st_atime; struct timespec st_atim;
long st_spare1; struct timespec st_mtim;
time_t st_mtime; struct timespec st_ctim;
long st_spare2; blksize_t st_blksize;
time_t st_ctime;
long st_spare3;
blksize_t st_blksize;
blkcnt_t st_blocks; blkcnt_t st_blocks;
#if !defined(__rtems__)
long st_spare4[2]; long st_spare4[2];
#endif #endif
#endif #endif
}; };
#if defined(__rtems__) #if !(defined(__svr4__) && !defined(__PPC__) && !defined(__sun__))
#define st_atime st_atim.tv_sec #define st_atime st_atim.tv_sec
#define st_ctime st_ctim.tv_sec #define st_ctime st_ctim.tv_sec
#define st_mtime st_mtim.tv_sec #define st_mtime st_mtim.tv_sec