stat.inc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by Jonas Maebe,
  4. member of the Free Pascal development team.
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$ifndef FPC_USE_LIBC} // kernel record
  12. Stat = packed record // No unix typing because of differences
  13. case byte of
  14. 0:
  15. (dev : qword;
  16. __pad0 : array[0..3] of byte;
  17. __ino,
  18. mode,
  19. nlink,
  20. uid,
  21. gid : cardinal;
  22. rdev : qword;
  23. __pad3 : array[0..3] of byte;
  24. size : qword;
  25. blksize : cardinal;
  26. blocks : qword;
  27. atime,
  28. atime_nsec,
  29. mtime,
  30. mtime_nsec,
  31. ctime,
  32. ctime_nsec : cardinal;
  33. ino : qword);
  34. 1:
  35. (st_dev : qword;
  36. __pad0_ : array[0..3] of byte;
  37. __st_ino_,
  38. st_mode,
  39. st_nlink,
  40. st_uid,
  41. st_gid : cardinal;
  42. st_rdev : qword;
  43. __pad3_ : array[0..3] of byte;
  44. st_size : qword;
  45. st_blksize: cardinal;
  46. st_blocks : qword;
  47. st_atime,
  48. st_atime_nsec,
  49. st_mtime,
  50. st_mtime_nsec,
  51. st_ctime,
  52. st_ctime_nsec : cardinal;
  53. st_ino : qword);
  54. end;
  55. {$else}
  56. {$packrecords C}
  57. Stat = Record
  58. case byte of
  59. 0:
  60. // kernel <->libc
  61. (dev : dev_t;
  62. pad1 : word;
  63. {$ifdef fs32bit}
  64. ino : ino_t;
  65. {$else}
  66. __ino : ino_t;
  67. {$endif}
  68. mode : mode_t;
  69. nlink : nlink_t;
  70. uid : uid_t;
  71. gid : gid_t;
  72. rdev : dev_t;
  73. pad2 : word;
  74. size : off_t;
  75. blksize : blksize_t;
  76. {$ifdef fs32bit}
  77. blocks : blkcnt_t;
  78. {$else}
  79. blocks : blkcnt64_t;
  80. {$endif}
  81. atime,
  82. atime_nsec,
  83. mtime,
  84. mtime_nsec,
  85. ctime,
  86. ctime_nsec : cardinal;
  87. {$ifdef fs32bit}
  88. unused4, unused5: cardinal;
  89. {$else}
  90. ino : ino64_t;
  91. {$endif});
  92. 1:
  93. // kernel <->libc
  94. (st_dev : dev_t;
  95. pad1_ : word;
  96. {$ifdef fs32bit}
  97. st_ino : ino_t;
  98. {$else}
  99. __st_ino : ino_t;
  100. {$endif}
  101. st_mode : mode_t;
  102. st_nlink : nlink_t;
  103. st_uid : uid_t;
  104. st_gid : gid_t;
  105. st_rdev : dev_t;
  106. pad2_ : word;
  107. st_size : off_t;
  108. st_blksize : blksize_t;
  109. {$ifdef fs32bit}
  110. st_blocks : blkcnt_t;
  111. {$else}
  112. st_blocks : blkcnt64_t;
  113. {$endif}
  114. st_atime,
  115. st_atime_nsec,
  116. st_mtime,
  117. st_mtime_nsec,
  118. st_ctime,
  119. st_ctime_nsec : culong;
  120. {$ifdef fs32bit}
  121. unused4_, unused5_: culong;
  122. {$else}
  123. st_ino : ino64_t;
  124. {$endif});
  125. end;
  126. {$endif}