From 5dd841936bbc9346f94832ddd58badc3a185f5ee Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sun, 12 May 2002 00:33:22 +0000 Subject: Fixes for 64 bit arches --- libc/sysdeps/linux/common/statfix64.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/statfix64.h b/libc/sysdeps/linux/common/statfix64.h index 8d6a86a01..a35ca7ae3 100644 --- a/libc/sysdeps/linux/common/statfix64.h +++ b/libc/sysdeps/linux/common/statfix64.h @@ -2,6 +2,7 @@ #define STATFIX_H #include +#include #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS @@ -16,7 +17,8 @@ # undef __USE_FILE_OFFSET64 #endif -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAVE_LFS__ +#if defined __WORDSIZE && __WORDSIZE < 64 #include @@ -34,6 +36,31 @@ #undef stat +/* Now pull in libc's version of stat */ +#define stat libc_stat +#define stat64 libc_stat64 +#include +#undef stat64 +#undef stat + +extern void statfix64(struct libc_stat64 *libcstat, struct kernel_stat64 *kstat); +extern int __fxstat64(int version, int fd, struct libc_stat64 * statbuf); +#else /* __WORDSIZE */ +#include + +/* Pull in whatever this particular arch's kernel thinks the kernel version of + * struct stat should look like. It turns out that each arch has a different + * opinion on the subject, and different kernel revs use different names... */ +#define stat kernel_stat +#define new_stat kernel_stat +#define kernel_stat64 kernel_stat +#include +#undef new_stat64 +#undef stat64 +#undef new_stat +#undef stat + + /* Now pull in libc's version of stat */ #define stat libc_stat #define stat64 libc_stat64 @@ -44,6 +71,7 @@ extern void statfix64(struct libc_stat64 *libcstat, struct kernel_stat64 *kstat); extern int __fxstat64(int version, int fd, struct libc_stat64 * statbuf); +#endif /* __WORDSIZE */ #endif /* __UCLIBC_HAVE_LFS__ */ #endif -- cgit v1.2.3