stat.inc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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
  13. case byte of
  14. 0:
  15. (dev : qword deprecated;
  16. __pad0 : array[0..3] of byte deprecated;
  17. __ino : cardinal deprecated;
  18. mode : cardinal deprecated;
  19. nlink : cardinal deprecated;
  20. uid : cardinal deprecated;
  21. gid : cardinal deprecated;
  22. rdev : qword deprecated;
  23. __pad3 : array[0..3] of byte deprecated;
  24. size : qword deprecated;
  25. blksize : cardinal deprecated;
  26. blocks : qword deprecated;
  27. atime : cardinal deprecated;
  28. atime_nsec : cardinal deprecated;
  29. mtime : cardinal deprecated;
  30. mtime_nsec : cardinal deprecated;
  31. ctime : cardinal deprecated;
  32. ctime_nsec : cardinal deprecated;
  33. ino : qword deprecated);
  34. 1: // Unix typing will be reintroduced.
  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. // info taken from /usr/include/asm-i386/stat.h you must have some -dev installed for this I think.. or linux-headers
  57. {$packrecords C}
  58. {$ifdef fs32bit}
  59. Stat = Record
  60. case byte of
  61. 0:(dev: cuLong deprecated;
  62. ino: cuLong deprecated;
  63. mode: cuShort deprecated;
  64. nlink: cuShort deprecated;
  65. uid: cuShort deprecated;
  66. gid: cuShort deprecated;
  67. rdev: cuLong deprecated;
  68. size: cuLong deprecated;
  69. blksize: cuLong deprecated;
  70. blocks: cuLong deprecated;
  71. atime: cuLong deprecated;
  72. atime_nsec: cuLong deprecated;
  73. mtime: cuLong deprecated;
  74. mtime_nsec: cuLong deprecated;
  75. ctime: cuLong deprecated;
  76. ctime_nsec: cuLong deprecated;
  77. __unused4: cuLong deprecated;
  78. __unused5: cuLong deprecated);
  79. 1:(st_dev: cuLong;
  80. st_ino: cuLong;
  81. st_mode: cuShort;
  82. st_nlink: cuShort;
  83. st_uid: cuShort;
  84. st_gid: cuShort;
  85. st_rdev: cuLong;
  86. st_size: cuLong;
  87. st_blksize: cuLong;
  88. st_blocks: cuLong;
  89. st_atime: cuLong;
  90. st_atime_nsec: cuLong;
  91. st_mtime: cuLong;
  92. st_mtime_nsec: cuLong;
  93. st_ctime: cuLong;
  94. st_ctime_nsec: cuLong;
  95. __unused4_: cuLong;
  96. __unused5_: cuLong);
  97. end;
  98. {$else} // 64 bit stat
  99. Stat = record
  100. case Byte of
  101. 0 :(dev: cuLongLong deprecated;
  102. __pad0: array[0..3] of cuChar deprecated;
  103. __ino: cuLong deprecated;
  104. mode: cuInt deprecated;
  105. nlink: cuInt deprecated;
  106. uid: cuLong deprecated;
  107. gid: cuLong deprecated;
  108. rdev: cuLongLong deprecated;
  109. __pad3: array[0..3] of cuChar deprecated;
  110. size: cLongLong deprecated;
  111. blksize: cuLong deprecated;
  112. blocks: cuLongLong deprecated; //* Number 512-byte blocks allocated. */
  113. atime: cuLong deprecated;
  114. atime_nsec: cuLong deprecated;
  115. mtime: cuLong deprecated;
  116. mtime_nsec: cuInt deprecated;
  117. ctime: cuLong deprecated;
  118. ctime_nsec: cuLong deprecated;
  119. ino: cuLongLong deprecated);
  120. 1 :(st_dev: cuLongLong;
  121. __pad0_: array[0..3] of cuChar;
  122. __st_ino: cuLong;
  123. st_mode: cuInt;
  124. st_nlink: cuInt;
  125. st_uid: cuLong;
  126. st_gid: cuLong;
  127. st_rdev: cuLongLong;
  128. __pad3_: array[0..3] of cuChar;
  129. st_size: cLongLong;
  130. st_blksize: cuLong;
  131. st_blocks: cuLongLong; //* Number 512-byte blocks allocated. */
  132. st_atime: cuLong;
  133. st_atime_nsec: cuLong;
  134. st_mtime: cuLong;
  135. st_mtime_nsec: cuInt;
  136. st_ctime: cuLong;
  137. st_ctime_nsec: cuLong;
  138. st_ino: cuLongLong);
  139. end;
  140. {$endif}
  141. {$endif}