y2038: stat: avoid 'time_t' in 'struct stat'
The time_t definition may differ between user space and kernel space, so replace time_t with an unambiguous 'long' for the mips and sparc. The same structures also contain 'off_t', which has the same problem, so replace that as well on those two architectures and powerpc. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
@@ -26,17 +26,17 @@ struct stat {
|
|||||||
gid_t st_gid;
|
gid_t st_gid;
|
||||||
unsigned st_rdev;
|
unsigned st_rdev;
|
||||||
long st_pad2[2];
|
long st_pad2[2];
|
||||||
off_t st_size;
|
long st_size;
|
||||||
long st_pad3;
|
long st_pad3;
|
||||||
/*
|
/*
|
||||||
* Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
* Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
||||||
* but we don't have it under Linux.
|
* but we don't have it under Linux.
|
||||||
*/
|
*/
|
||||||
time_t st_atime;
|
long st_atime;
|
||||||
long st_atime_nsec;
|
long st_atime_nsec;
|
||||||
time_t st_mtime;
|
long st_mtime;
|
||||||
long st_mtime_nsec;
|
long st_mtime_nsec;
|
||||||
time_t st_ctime;
|
long st_ctime;
|
||||||
long st_ctime_nsec;
|
long st_ctime_nsec;
|
||||||
long st_blksize;
|
long st_blksize;
|
||||||
long st_blocks;
|
long st_blocks;
|
||||||
@@ -70,13 +70,13 @@ struct stat64 {
|
|||||||
* Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
* Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
||||||
* but we don't have it under Linux.
|
* but we don't have it under Linux.
|
||||||
*/
|
*/
|
||||||
time_t st_atime;
|
long st_atime;
|
||||||
unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
|
unsigned long st_atime_nsec; /* Reserved for st_atime expansion */
|
||||||
|
|
||||||
time_t st_mtime;
|
long st_mtime;
|
||||||
unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
|
unsigned long st_mtime_nsec; /* Reserved for st_mtime expansion */
|
||||||
|
|
||||||
time_t st_ctime;
|
long st_ctime;
|
||||||
unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
|
unsigned long st_ctime_nsec; /* Reserved for st_ctime expansion */
|
||||||
|
|
||||||
unsigned long st_blksize;
|
unsigned long st_blksize;
|
||||||
@@ -105,7 +105,7 @@ struct stat {
|
|||||||
unsigned int st_rdev;
|
unsigned int st_rdev;
|
||||||
unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
|
unsigned int st_pad1[3]; /* Reserved for st_rdev expansion */
|
||||||
|
|
||||||
off_t st_size;
|
long st_size;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
* Actually this should be timestruc_t st_atime, st_mtime and st_ctime
|
||||||
|
@@ -40,7 +40,7 @@ struct stat {
|
|||||||
uid_t st_uid;
|
uid_t st_uid;
|
||||||
gid_t st_gid;
|
gid_t st_gid;
|
||||||
unsigned long st_rdev;
|
unsigned long st_rdev;
|
||||||
off_t st_size;
|
long st_size;
|
||||||
unsigned long st_blksize;
|
unsigned long st_blksize;
|
||||||
unsigned long st_blocks;
|
unsigned long st_blocks;
|
||||||
unsigned long st_atime;
|
unsigned long st_atime;
|
||||||
|
@@ -14,12 +14,12 @@ struct stat {
|
|||||||
uid_t st_uid;
|
uid_t st_uid;
|
||||||
gid_t st_gid;
|
gid_t st_gid;
|
||||||
unsigned int st_rdev;
|
unsigned int st_rdev;
|
||||||
off_t st_size;
|
long st_size;
|
||||||
time_t st_atime;
|
long st_atime;
|
||||||
time_t st_mtime;
|
long st_mtime;
|
||||||
time_t st_ctime;
|
long st_ctime;
|
||||||
off_t st_blksize;
|
long st_blksize;
|
||||||
off_t st_blocks;
|
long st_blocks;
|
||||||
unsigned long __unused4[2];
|
unsigned long __unused4[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -57,15 +57,15 @@ struct stat {
|
|||||||
unsigned short st_uid;
|
unsigned short st_uid;
|
||||||
unsigned short st_gid;
|
unsigned short st_gid;
|
||||||
unsigned short st_rdev;
|
unsigned short st_rdev;
|
||||||
off_t st_size;
|
long st_size;
|
||||||
time_t st_atime;
|
long st_atime;
|
||||||
unsigned long st_atime_nsec;
|
unsigned long st_atime_nsec;
|
||||||
time_t st_mtime;
|
long st_mtime;
|
||||||
unsigned long st_mtime_nsec;
|
unsigned long st_mtime_nsec;
|
||||||
time_t st_ctime;
|
long st_ctime;
|
||||||
unsigned long st_ctime_nsec;
|
unsigned long st_ctime_nsec;
|
||||||
off_t st_blksize;
|
long st_blksize;
|
||||||
off_t st_blocks;
|
long st_blocks;
|
||||||
unsigned long __unused4[2];
|
unsigned long __unused4[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user