From 1a6075d08d4f75b702d597e0e6d11fe93deeedb5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 16 Jul 2005 03:27:44 +0000 Subject: with the help of John Bowler, track down the ugly ABI change between 2.4 / 2.6 on big endian arm kernels and work around it best we can at runtime --- libc/sysdeps/linux/arm/bits/kernel_stat.h | 32 +++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'libc/sysdeps/linux/arm/bits/kernel_stat.h') diff --git a/libc/sysdeps/linux/arm/bits/kernel_stat.h b/libc/sysdeps/linux/arm/bits/kernel_stat.h index d482224ec..3cd9bd8dc 100644 --- a/libc/sysdeps/linux/arm/bits/kernel_stat.h +++ b/libc/sysdeps/linux/arm/bits/kernel_stat.h @@ -36,21 +36,45 @@ struct kernel_stat { unsigned long __unused5; }; +/* see the notes in common/xstatconv.c about why we have these + * funky funk unions here ... i blame the schools */ struct kernel_stat64 { - unsigned short st_dev; - unsigned char __pad0[10]; +#if defined(__ARMEB__) + union { + unsigned short old_abi; + unsigned long long new_abi; + } st_dev; +#else + unsigned long long st_dev; +#endif + unsigned char __pad0[4]; + #define _HAVE_STAT64___ST_INO unsigned long __st_ino; unsigned int st_mode; unsigned int st_nlink; unsigned long st_uid; unsigned long st_gid; - unsigned short st_rdev; - unsigned char __pad3[10]; + +#if defined(__ARMEB__) + union { + unsigned short old_abi; + unsigned long long new_abi; + } st_rdev; +#else + unsigned long long st_rdev; +#endif + unsigned char __pad3[4]; + long long st_size; unsigned long st_blksize; +#if defined(__ARMEB__) + unsigned long __pad_st_blocks; /* future possible st_blocks high bits */ + unsigned long st_blocks; /* Number 512-byte blocks allocated. */ +#else unsigned long st_blocks; /* Number 512-byte blocks allocated. */ unsigned long __pad4; /* future possible st_blocks high bits */ +#endif unsigned long st_atime; unsigned long st_atime_nsec; unsigned long st_mtime; -- cgit v1.2.3