statfix64.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef STATFIX_H
  2. #define STATFIX_H
  3. #include <features.h>
  4. #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
  5. #undef _FILE_OFFSET_BITS
  6. #define _FILE_OFFSET_BITS 64
  7. #endif
  8. #ifndef __USE_FILE_OFFSET64
  9. # define __USE_FILE_OFFSET64 1
  10. #endif
  11. #ifndef __USE_LARGEFILE64
  12. # define __USE_LARGEFILE64 1
  13. #endif
  14. #ifdef __UCLIBC_HAVE_LFS__
  15. #include <sys/types.h>
  16. /* Pull in whatever this particular arch's kernel thinks the kernel version of
  17. * struct stat should look like. It turns out that each arch has a different
  18. * opinion on the subject, and different kernel revs use different names... */
  19. #define stat kernel_stat
  20. #define new_stat kernel_stat
  21. #define stat64 kernel_stat64
  22. #define new_stat64 kernel_stat64
  23. #include <asm/stat.h>
  24. #undef new_stat64
  25. #undef stat64
  26. #undef new_stat
  27. #undef stat
  28. /* Now pull in libc's version of stat */
  29. #define stat libc_stat
  30. #define stat64 libc_stat64
  31. #include <sys/stat.h>
  32. #undef stat64
  33. #undef stat
  34. extern void statfix64(struct libc_stat64 *libcstat, struct kernel_stat64 *kstat);
  35. extern int __fxstat64(int version, int fd, struct libc_stat64 * statbuf);
  36. #endif /* __UCLIBC_HAVE_LFS__ */
  37. #endif