stat.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef __ASM_GENERIC_STAT_H
  2. #define __ASM_GENERIC_STAT_H
  3. /*
  4. * Everybody gets this wrong and has to stick with it for all
  5. * eternity. Hopefully, this version gets used by new architectures
  6. * so they don't fall into the same traps.
  7. *
  8. * stat64 is copied from powerpc64, with explicit padding added.
  9. * stat is the same structure layout on 64-bit, without the 'long long'
  10. * types.
  11. *
  12. * By convention, 64 bit architectures use the stat interface, while
  13. * 32 bit architectures use the stat64 interface. Note that we don't
  14. * provide an __old_kernel_stat here, which new architecture should
  15. * not have to start with.
  16. */
  17. #include <asm/bitsperlong.h>
  18. #define STAT_HAVE_NSEC 1
  19. struct stat {
  20. unsigned long st_dev; /* Device. */
  21. unsigned long st_ino; /* File serial number. */
  22. unsigned int st_mode; /* File mode. */
  23. unsigned int st_nlink; /* Link count. */
  24. unsigned int st_uid; /* User ID of the file's owner. */
  25. unsigned int st_gid; /* Group ID of the file's group. */
  26. unsigned long st_rdev; /* Device number, if device. */
  27. unsigned long __pad1;
  28. long st_size; /* Size of file, in bytes. */
  29. int st_blksize; /* Optimal block size for I/O. */
  30. int __pad2;
  31. long st_blocks; /* Number 512-byte blocks allocated. */
  32. long st_atime; /* Time of last access. */
  33. unsigned long st_atime_nsec;
  34. long st_mtime; /* Time of last modification. */
  35. unsigned long st_mtime_nsec;
  36. long st_ctime; /* Time of last status change. */
  37. unsigned long st_ctime_nsec;
  38. unsigned int __unused4;
  39. unsigned int __unused5;
  40. };
  41. /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
  42. #if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64)
  43. struct stat64 {
  44. unsigned long long st_dev; /* Device. */
  45. unsigned long long st_ino; /* File serial number. */
  46. unsigned int st_mode; /* File mode. */
  47. unsigned int st_nlink; /* Link count. */
  48. unsigned int st_uid; /* User ID of the file's owner. */
  49. unsigned int st_gid; /* Group ID of the file's group. */
  50. unsigned long long st_rdev; /* Device number, if device. */
  51. unsigned long long __pad1;
  52. long long st_size; /* Size of file, in bytes. */
  53. int st_blksize; /* Optimal block size for I/O. */
  54. int __pad2;
  55. long long st_blocks; /* Number 512-byte blocks allocated. */
  56. int st_atime; /* Time of last access. */
  57. unsigned int st_atime_nsec;
  58. int st_mtime; /* Time of last modification. */
  59. unsigned int st_mtime_nsec;
  60. int st_ctime; /* Time of last status change. */
  61. unsigned int st_ctime_nsec;
  62. unsigned int __unused4;
  63. unsigned int __unused5;
  64. };
  65. #endif
  66. #endif /* __ASM_GENERIC_STAT_H */