statfix64.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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_LARGEFILE64
  9. # define __USE_LARGEFILE64 1
  10. #endif
  11. /* We absolutely do _NOT_ want interfaces silently
  12. * * renamed under us or very bad things will happen... */
  13. #ifdef __USE_FILE_OFFSET64
  14. # undef __USE_FILE_OFFSET64
  15. #endif
  16. #ifdef __UCLIBC_HAVE_LFS__
  17. #include <sys/types.h>
  18. /* Pull in whatever this particular arch's kernel thinks the kernel version of
  19. * struct stat should look like. It turns out that each arch has a different
  20. * opinion on the subject, and different kernel revs use different names... */
  21. #define stat kernel_stat
  22. #define new_stat kernel_stat
  23. #define stat64 kernel_stat64
  24. #define new_stat64 kernel_stat64
  25. #include <asm/stat.h>
  26. #undef new_stat64
  27. #undef stat64
  28. #undef new_stat
  29. #undef stat
  30. /* Now pull in libc's version of stat */
  31. #define stat libc_stat
  32. #define stat64 libc_stat64
  33. #include <sys/stat.h>
  34. #undef stat64
  35. #undef stat
  36. extern void statfix64(struct libc_stat64 *libcstat, struct kernel_stat64 *kstat);
  37. extern int __fxstat64(int version, int fd, struct libc_stat64 * statbuf);
  38. #endif /* __UCLIBC_HAVE_LFS__ */
  39. #endif