dirent.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  3. *
  4. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  5. */
  6. #ifndef _DIRENT_H
  7. # error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
  8. #endif
  9. #include <bits/align64bit.h>
  10. #include <endian.h>
  11. struct dirent
  12. {
  13. #ifndef __USE_FILE_OFFSET64
  14. # if __BYTE_ORDER == __LITTLE_ENDIAN
  15. __U32_TYPE d_ino;
  16. __U32_TYPE __pad1;
  17. __S32_TYPE d_off;
  18. __S32_TYPE __pad2;
  19. # else
  20. __U32_TYPE __pad1;
  21. __U32_TYPE d_ino;
  22. __S32_TYPE __pad2;
  23. __S32_TYPE d_off;
  24. # endif /* __LITTLE_ENDIAN */
  25. #else
  26. __U64_TYPE d_ino;
  27. __S64_TYPE d_off;
  28. #endif
  29. unsigned short int d_reclen;
  30. unsigned char d_type;
  31. char d_name[256]; /* We must not include limits.h! */
  32. } __ARCH_64BIT_ALIGNMENT__;
  33. #ifdef __USE_LARGEFILE64
  34. struct dirent64
  35. {
  36. __U64_TYPE d_ino;
  37. __S64_TYPE d_off;
  38. unsigned short int d_reclen;
  39. unsigned char d_type;
  40. char d_name[256]; /* We must not include limits.h! */
  41. };
  42. #endif
  43. #define d_fileno d_ino /* Backwards compatibility. */
  44. #undef _DIRENT_HAVE_D_NAMLEN
  45. #define _DIRENT_HAVE_D_RECLEN
  46. #define _DIRENT_HAVE_D_OFF
  47. #define _DIRENT_HAVE_D_TYPE