systypes.inc 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. {
  2. <<<<<<< systypes.inc
  3. $Id$
  4. =======
  5. $Id$
  6. >>>>>>> 1.1.2.2
  7. This file is part of the Free Pascal run time library.
  8. Copyright (c) 1999-2000 by Michael Van Canneyt,
  9. member of the Free Pascal development team.
  10. See the file COPYING.FPC, included in this distribution,
  11. for details about the copyright.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. **********************************************************************}
  16. type
  17. {
  18. Linux system calls take arguments as follows :
  19. i386/m68k:
  20. %eax/%d0 : System call number
  21. %ebx/%d1 : first argument
  22. %ecx/%d2 : second argument
  23. %edx/%d3 : third argumens
  24. %esi/%d3 : fourth argument
  25. %edi/%d4 : fifth argument
  26. That is why we define a special type, with only these arguments
  27. To make it processor independent, we don't give any system dependent
  28. names, but the rather abstract reg1,reg2 etc;
  29. SysCallRegs=record
  30. reg1,reg2,reg3,reg4,reg5,reg6 : longint;
  31. end;
  32. PSysCallRegs=^SysCallRegs;
  33. TSysCallRegs=SysCallRegs;
  34. }
  35. { The following are records for system calls BSD updated }
  36. dirent = packed record
  37. ino : cardinal; { This is not inode number, but "a number
  38. unique for each file on a filesystem"}
  39. reclen : word;
  40. d_type,
  41. namlen : byte;
  42. name : array [0..255] of char;
  43. end;
  44. pdirent =^dirent;
  45. TDirEnt = dirent;
  46. TDir= packed record {BSD libc record.}
  47. fd : longint; { file descriptor associated with directory }
  48. loc, { offset in current buffer }
  49. size : cardinal; { amount of data returned by getdirentries}
  50. buf : pdirent; { data buffer, actually a pchar}
  51. len : longint; { size of data buffer }
  52. seek, { magic cookie returned by getdirentries}
  53. rewind: cardinal; { magic cookie for rewinding}
  54. flags : longint; { flags for readdir }
  55. end;
  56. { Linux kernel record
  57. TDir = packed record
  58. fd : longint;
  59. loc : longint;
  60. size : integer;
  61. buf : pdirent;
  62. {The following are used in libc, but NOT in the linux kernel sources ??}
  63. nextoff: longint;
  64. dd_max : integer; {size of buf. Irrelevant, as buf is of type dirent}
  65. lock : pointer;
  66. dummy : array[0..1023] of char;
  67. end;}
  68. PDir =^TDir;
  69. {$packrecords C}
  70. Stat =record {BSD version}
  71. dev, { inode's device }
  72. ino : cardinal; { inode's number }
  73. mode, { inode protection mode }
  74. nlink : word; { number of hard links }
  75. uid, { user ID of the file's owner }
  76. gid, { group ID of the file's group }
  77. dev_t : cardinal; { device type }
  78. atime, { time of last access }
  79. atime_nsec, { nsec of last access }
  80. mtime, { time of last data modification }
  81. mtime_nsec, { nsec of last data modification }
  82. ctime, { time of last file status change }
  83. ctime_nsec : longint; { nsec of last file status change }
  84. size, { file size, in bytes }
  85. blocks : Int64; { blocks allocated for file }
  86. blksze, { optimal blocksize for I/O }
  87. flags, { user defined flags for file }
  88. filegen : cardinal; { file generation number }
  89. lspare : longint;
  90. qspare : array[0..1] of int64;
  91. end;
  92. PStat=^Stat;
  93. TStat=Stat;
  94. Statfs = packed record
  95. spare2, { place holder}
  96. bsize, { fundamental block size}
  97. iosize, { optimal block size }
  98. blocks, { total blocks}
  99. bfree, { blocks free}
  100. bavail, { block available for mortal users}
  101. files, { Total file nodes}
  102. ffree : longint; { file nodes free}
  103. fsid : array[0..1] of longint;
  104. fowner : longint; {mounter uid}
  105. ftype : longint;
  106. fflags : longint; {copy of mount flags}
  107. spare : array [0..1] of longint; { For later use }
  108. fstypename : array[0..15] of char;
  109. mountpoint : array[0..89] of char;
  110. mnfromname : array[0..89] of char;
  111. end;
  112. PStatFS=^StatFS;
  113. TStatFS=StatFS;
  114. fdSet=array[0..7] of longint;{=256 bits}
  115. pfdset=^fdset;
  116. TFDSet=fdset;
  117. timeval = packed record
  118. sec,usec:int64;
  119. end;
  120. ptimeval=^timeval;
  121. TTimeVal=timeval;
  122. timespec = packed record
  123. tv_sec,tv_nsec:{longint or int64 ?}int64;
  124. end;
  125. timezone = packed record
  126. minuteswest,dsttime:longint;
  127. end;
  128. ptimezone =^timezone;
  129. TTimeZone = timezone;
  130. utsname = packed record
  131. sysname,
  132. nodename,
  133. release,
  134. version,
  135. machine,
  136. domainname : Array[0..64] of char;
  137. end;
  138. PUTSName=^UTSName;
  139. TUTSName=UTSName;
  140. {
  141. $Log$
  142. Revision 1.3 2000-10-26 23:00:12 peter
  143. * fixes merges
  144. Revision 1.2 2000/09/18 13:42:35 marco
  145. * FreeBSD support into 1.1
  146. Revision 1.4 2000/09/11 14:38:10 marco
  147. * 14 april version killed, and replaced by newer fixes branch version
  148. }