glob64.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include <features.h>
  2. #ifdef __UCLIBC_HAS_LFS__
  3. #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
  4. #undef _FILE_OFFSET_BITS
  5. #define _FILE_OFFSET_BITS 64
  6. #endif
  7. #ifndef __USE_LARGEFILE64
  8. # define __USE_LARGEFILE64 1
  9. #endif
  10. /* We absolutely do _NOT_ want interfaces silently
  11. * renamed under us or very bad things will happen... */
  12. #ifdef __USE_FILE_OFFSET64
  13. # undef __USE_FILE_OFFSET64
  14. #endif
  15. #include <dirent.h>
  16. #include <glob.h>
  17. #include <sys/stat.h>
  18. extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden;
  19. extern int __glob64 (__const char *__restrict __pattern, int __flags,
  20. int (*__errfunc) (__const char *, int),
  21. glob64_t *__restrict __pglob) __THROW attribute_hidden;
  22. extern void __globfree (glob_t *__pglob) __THROW attribute_hidden;
  23. extern void __globfree64 (glob64_t *__pglob) __THROW attribute_hidden;
  24. #define dirent dirent64
  25. #define __readdir(dirp) __readdir64(dirp)
  26. #define glob_t glob64_t
  27. #define __glob(pattern, flags, errfunc, pglob) \
  28. __glob64 (pattern, flags, errfunc, pglob)
  29. #define glob(pattern, flags, errfunc, pglob) \
  30. glob64 (pattern, flags, errfunc, pglob)
  31. #define __globfree(pglob) __globfree64 (pglob)
  32. #define globfree(pglob) globfree64 (pglob)
  33. #undef stat
  34. #define stat stat64
  35. #define __lstat __lstat64
  36. #define __GLOB64 1
  37. #include "glob.c"
  38. #endif