y2038: stat: avoid 'time_t' in 'struct stat'
authorArnd Bergmann <arnd@arndb.de>
Tue, 5 Nov 2019 08:22:38 +0000 (09:22 +0100)
committerArnd Bergmann <arnd@arndb.de>
Fri, 15 Nov 2019 13:38:28 +0000 (14:38 +0100)
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>
arch/mips/include/uapi/asm/stat.h
arch/powerpc/include/uapi/asm/stat.h
arch/sparc/include/uapi/asm/stat.h

index 95416f366d7f8a18dc0e9a56cd33e3edbdc6bc9e..3d2a3b71845cf2a1d748c3d0bdcfb3a5d0c95c59 100644 (file)
@@ -26,17 +26,17 @@ struct stat {
        gid_t           st_gid;
        unsigned        st_rdev;
        long            st_pad2[2];
-       off_t           st_size;
+       long            st_size;
        long            st_pad3;
        /*
         * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
         * but we don't have it under Linux.
         */
-       time_t          st_atime;
+       long            st_atime;
        long            st_atime_nsec;
-       time_t          st_mtime;
+       long            st_mtime;
        long            st_mtime_nsec;
-       time_t          st_ctime;
+       long            st_ctime;
        long            st_ctime_nsec;
        long            st_blksize;
        long            st_blocks;
@@ -70,13 +70,13 @@ struct stat64 {
         * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
         * 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  */
 
-       time_t          st_mtime;
+       long            st_mtime;
        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_blksize;
@@ -105,7 +105,7 @@ struct stat {
        unsigned int            st_rdev;
        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
index afd25f2ff4e8d5cb8e84e742f19de6808c65c9f3..7871055e5e32dbfa1a2085906610a37c66f6c23c 100644 (file)
@@ -40,7 +40,7 @@ struct stat {
        uid_t           st_uid;
        gid_t           st_gid;
        unsigned long   st_rdev;
-       off_t           st_size;
+       long            st_size;
        unsigned long   st_blksize;
        unsigned long   st_blocks;
        unsigned long   st_atime;
index b6ec4eb217f788b6d08a73b7d315d8626cf1db7f..732c41720e24624f41b992ffd89a3498ab212a34 100644 (file)
@@ -14,12 +14,12 @@ struct stat {
        uid_t   st_uid;
        gid_t   st_gid;
        unsigned int st_rdev;
-       off_t   st_size;
-       time_t  st_atime;
-       time_t  st_mtime;
-       time_t  st_ctime;
-       off_t   st_blksize;
-       off_t   st_blocks;
+       long    st_size;
+       long    st_atime;
+       long    st_mtime;
+       long    st_ctime;
+       long    st_blksize;
+       long    st_blocks;
        unsigned long  __unused4[2];
 };
 
@@ -57,15 +57,15 @@ struct stat {
        unsigned short  st_uid;
        unsigned short  st_gid;
        unsigned short  st_rdev;
-       off_t           st_size;
-       time_t          st_atime;
+       long            st_size;
+       long            st_atime;
        unsigned long   st_atime_nsec;
-       time_t          st_mtime;
+       long            st_mtime;
        unsigned long   st_mtime_nsec;
-       time_t          st_ctime;
+       long            st_ctime;
        unsigned long   st_ctime_nsec;
-       off_t           st_blksize;
-       off_t           st_blocks;
+       long            st_blksize;
+       long            st_blocks;
        unsigned long   __unused4[2];
 };