From cad937c12d93653ed1bf548eed8fc1a178f991d8 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 17 Oct 2001 01:10:29 +0000 Subject: This commit makes large file support actually work (when enabled in the config file). I've tested this and it works for me. -Erik --- libc/sysdeps/linux/common/statfix64.h | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 libc/sysdeps/linux/common/statfix64.h (limited to 'libc/sysdeps/linux/common/statfix64.h') diff --git a/libc/sysdeps/linux/common/statfix64.h b/libc/sysdeps/linux/common/statfix64.h new file mode 100644 index 000000000..acf9e8440 --- /dev/null +++ b/libc/sysdeps/linux/common/statfix64.h @@ -0,0 +1,41 @@ +#ifndef STATFIX_H +#define STATFIX_H + +#include + +#define _FILE_OFFSET_BITS 64 +#define __USE_FILE_OFFSET64 +#define __USE_LARGEFILE64 + +#ifdef __UCLIBC_HAVE_LFS__ + +#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 stat64 kernel_stat64 +#define new_stat64 kernel_stat64 +#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 +#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); + +#endif /* __UCLIBC_HAVE_LFS__ */ + +#endif + -- cgit v1.2.3