7729eb
commit 76843f3b3ecb886b8d300220e6ec378e0fd09a8b
7729eb
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
7729eb
Date:   Wed Oct 6 08:10:13 2021 -0300
7729eb
7729eb
    y2038: Use a common definition for stat for sparc32
7729eb
    
7729eb
    The sparc32 misses support for support done by 4e8521333bea6.
7729eb
    
7729eb
    Checked on sparcv9-linux-gnu.
7729eb
    
7729eb
    (cherry picked from commit d2b1254db208b35ff060f00a15f22a1eed5306d2)
7729eb
7729eb
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h b/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h
7729eb
index b481b4f9f80a94f4..45db6b6ffbb19b8b 100644
7729eb
--- a/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h
7729eb
+++ b/sysdeps/unix/sysv/linux/sparc/bits/struct_stat.h
7729eb
@@ -28,32 +28,35 @@
7729eb
 
7729eb
 struct stat
7729eb
   {
7729eb
+#ifdef __USE_TIME_BITS64
7729eb
+# include <bits/struct_stat_time64_helper.h>
7729eb
+#else
7729eb
     __dev_t st_dev;			/* Device.  */
7729eb
-#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
7729eb
+# if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
7729eb
     unsigned short int __pad1;
7729eb
     __ino_t st_ino;			/* File serial number.	*/
7729eb
-#else
7729eb
+# else
7729eb
     __ino64_t st_ino;			/* File serial number.	*/
7729eb
-#endif
7729eb
+# endif
7729eb
     __mode_t st_mode;			/* File mode.  */
7729eb
     __nlink_t st_nlink;			/* Link count.  */
7729eb
     __uid_t st_uid;			/* User ID of the file's owner.	*/
7729eb
     __gid_t st_gid;			/* Group ID of the file's group.*/
7729eb
     __dev_t st_rdev;			/* Device number, if device.  */
7729eb
     unsigned short int __pad2;
7729eb
-#ifndef __USE_FILE_OFFSET64
7729eb
+# ifndef __USE_FILE_OFFSET64
7729eb
     __off_t st_size;			/* Size of file, in bytes.  */
7729eb
-#else
7729eb
+# else
7729eb
     __off64_t st_size;			/* Size of file, in bytes.  */
7729eb
-#endif
7729eb
+# endif
7729eb
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
7729eb
 
7729eb
-#ifndef __USE_FILE_OFFSET64
7729eb
+# ifndef __USE_FILE_OFFSET64
7729eb
     __blkcnt_t st_blocks;		/* Number 512-byte blocks allocated. */
7729eb
-#else
7729eb
+# else
7729eb
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
7729eb
-#endif
7729eb
-#ifdef __USE_XOPEN2K8
7729eb
+# endif
7729eb
+# ifdef __USE_XOPEN2K8
7729eb
     /* Nanosecond resolution timestamps are stored in a format
7729eb
        equivalent to 'struct timespec'.  This is the type used
7729eb
        whenever possible but the Unix namespace rules do not allow the
7729eb
@@ -63,28 +66,32 @@ struct stat
7729eb
     struct timespec st_atim;		/* Time of last access.  */
7729eb
     struct timespec st_mtim;		/* Time of last modification.  */
7729eb
     struct timespec st_ctim;		/* Time of last status change.  */
7729eb
-# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
7729eb
-# define st_mtime st_mtim.tv_sec
7729eb
-# define st_ctime st_ctim.tv_sec
7729eb
-#else
7729eb
+#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
7729eb
+#  define st_mtime st_mtim.tv_sec
7729eb
+#  define st_ctime st_ctim.tv_sec
7729eb
+# else
7729eb
     __time_t st_atime;			/* Time of last access.  */
7729eb
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
7729eb
     __time_t st_mtime;			/* Time of last modification.  */
7729eb
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
7729eb
     __time_t st_ctime;			/* Time of last status change.  */
7729eb
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
7729eb
-#endif
7729eb
+# endif
7729eb
     unsigned long int __glibc_reserved4;
7729eb
     unsigned long int __glibc_reserved5;
7729eb
+#endif /* __USE_TIME_BITS64  */
7729eb
   };
7729eb
 
7729eb
 #ifdef __USE_LARGEFILE64
7729eb
 struct stat64
7729eb
   {
7729eb
+# ifdef __USE_TIME_BITS64
7729eb
+#  include <bits/struct_stat_time64_helper.h>
7729eb
+# else
7729eb
     __dev_t st_dev;			/* Device.  */
7729eb
-# if __WORDSIZE == 64
7729eb
+#  if __WORDSIZE == 64
7729eb
     unsigned short int __pad1;
7729eb
-# endif
7729eb
+#  endif
7729eb
     __ino64_t st_ino;			/* File serial number.	*/
7729eb
     __mode_t st_mode;			/* File mode.  */
7729eb
     __nlink_t st_nlink;			/* Link count.  */
7729eb
@@ -96,7 +103,7 @@ struct stat64
7729eb
     __blksize_t st_blksize;		/* Optimal block size for I/O.  */
7729eb
 
7729eb
     __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
7729eb
-# ifdef __USE_XOPEN2K8
7729eb
+#  ifdef __USE_XOPEN2K8
7729eb
     /* Nanosecond resolution timestamps are stored in a format
7729eb
        equivalent to 'struct timespec'.  This is the type used
7729eb
        whenever possible but the Unix namespace rules do not allow the
7729eb
@@ -106,19 +113,20 @@ struct stat64
7729eb
     struct timespec st_atim;		/* Time of last access.  */
7729eb
     struct timespec st_mtim;		/* Time of last modification.  */
7729eb
     struct timespec st_ctim;		/* Time of last status change.  */
7729eb
-#  define st_atime st_atim.tv_sec	/* Backward compatibility.  */
7729eb
-#  define st_mtime st_mtim.tv_sec
7729eb
-#  define st_ctime st_ctim.tv_sec
7729eb
-# else
7729eb
+#   define st_atime st_atim.tv_sec	/* Backward compatibility.  */
7729eb
+#   define st_mtime st_mtim.tv_sec
7729eb
+#   define st_ctime st_ctim.tv_sec
7729eb
+#  else
7729eb
     __time_t st_atime;			/* Time of last access.  */
7729eb
     unsigned long int st_atimensec;	/* Nscecs of last access.  */
7729eb
     __time_t st_mtime;			/* Time of last modification.  */
7729eb
     unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
7729eb
     __time_t st_ctime;			/* Time of last status change.  */
7729eb
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
7729eb
-# endif
7729eb
+#  endif
7729eb
     unsigned long int __glibc_reserved4;
7729eb
     unsigned long int __glibc_reserved5;
7729eb
+# endif /* __USE_TIME_BITS64  */
7729eb
   };
7729eb
 #endif
7729eb