From e6d0f71e6a33a861a0b1fd2d2e9154c2f246c859 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 7 Aug 2007 01:22:49 +0000 Subject: [PATCH] 2007-08-06 Jan Kratochvil * file.c [!HAVE_STAT64 && LINUX && X86_64] (struct stat64): Define it. [!HAVE_STAT64 && LINUX && X86_64] (HAVE_STAT64, STAT64_SIZE): Define. [HAVE_STAT64] (printstat64) [STAT64_SIZE]: Add compile-time assertion. Fixes RH#222275. --- file.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/file.c b/file.c index 6e6b3067..a8af0b07 100644 --- a/file.c +++ b/file.c @@ -986,6 +986,38 @@ long addr; } #endif /* !HAVE_LONG_LONG_OFF_T */ +#if !defined HAVE_STAT64 && defined LINUX && defined X86_64 +/* + * Linux x86_64 has unified `struct stat' but its i386 biarch needs + * `struct stat64'. Its definition expects 32-bit `long'. + * is not in the public includes set. + * __GNUC__ is needed for the required __attribute__ below. + */ +struct stat64 { + unsigned long long st_dev; + unsigned char __pad0[4]; + unsigned int __st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned int st_uid; + unsigned int st_gid; + unsigned long long st_rdev; + unsigned char __pad3[4]; + long long st_size; + unsigned int st_blksize; + unsigned long long st_blocks; + unsigned int st_atime; + unsigned int st_atime_nsec; + unsigned int st_mtime; + unsigned int st_mtime_nsec; + unsigned int st_ctime; + unsigned int st_ctime_nsec; + unsigned long long st_ino; +} __attribute__((packed)); +# define HAVE_STAT64 1 +# define STAT64_SIZE 96 +#endif + #ifdef HAVE_STAT64 static void printstat64(tcp, addr) @@ -994,6 +1026,10 @@ long addr; { struct stat64 statbuf; +#ifdef STAT64_SIZE + (void) sizeof(char[sizeof statbuf == STAT64_SIZE ? 1 : -1]); +#endif + #ifdef LINUXSPARC if (current_personality == 1) { printstatsol(tcp, addr); @@ -2114,7 +2150,7 @@ decode_utimes(struct tcb *tcp, int offset, int special) printtv_bitness(tcp, tcp->u_arg[offset + 1], BITNESS_CURRENT, special); tprintf(", "); - printtv_bitness(tcp, tcp->u_arg[offset + 1] + printtv_bitness(tcp, tcp->u_arg[offset + 1] + sizeof (struct timeval), BITNESS_CURRENT, special); tprintf("}"); -- 2.40.0