systypes.inc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Michael Van Canneyt,
  5. member of the Free Pascal development team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {type}
  13. {
  14. Linux system calls take arguments as follows :
  15. i386 m68k ppc
  16. %eax %d0 r0 System call number
  17. %ebx %d1 r3 first argument
  18. %ecx %d2 r4 second argument
  19. %edx %d3 r5 third argumens
  20. %esi %d3 r6 fourth argument
  21. %edi %d4 r7 fifth argument
  22. That is why we define a special type, with only these arguments
  23. To make it processor independent, we don't give any system dependent
  24. names, but the rather abstract reg1,reg2 etc;
  25. SysCallRegs=record
  26. reg1,reg2,reg3,reg4,reg5,reg6 : longint;
  27. end;
  28. PSysCallRegs=^SysCallRegs;
  29. TSysCallRegs=SysCallRegs;
  30. }
  31. {
  32. TStatfs = packed record
  33. fstype, { File system type }
  34. bsize, { Optimal block trensfer size }
  35. blocks, { Data blocks in system }
  36. bfree, { free blocks in system }
  37. bavail, { Available free blocks to non-root users }
  38. files, { File nodes in system }
  39. ffree, { Free file nodes in system }
  40. fsid, { File system ID }
  41. namelen : longint; { Maximum name length in system }
  42. spare : array [0..6] of longint; { For later use }
  43. end;
  44. PStatFS=^TStatFS;
  45. }
  46. {
  47. { The following are records for system calls }
  48. dirent = packed record
  49. ino,
  50. off : longint;
  51. reclen : word;
  52. name : array [0..255] of char;
  53. end;
  54. pdirent =^dirent;
  55. TDirEnt = dirent;
  56. TDir = packed record
  57. fd : integer;
  58. loc : longint;
  59. size : integer;
  60. buf : pdirent;
  61. {The following are used in libc, but NOT in the linux kernel sources ??}
  62. nextoff: longint;
  63. dd_max : integer; {size of buf. Irrelevant, as buf is of type dirent}
  64. lock : pointer;
  65. end;
  66. PDir =^TDir;
  67. }
  68. { can't put definition in stat.inc because stat.inc is also included in }
  69. { bunxtype.inc, which is used together with ptypes.inc, which defines }
  70. { def_t in another way :( }
  71. {
  72. {$ifdef cpui386}
  73. dev_t = word;
  74. {$else cpui386}
  75. {$ifdef cpum68k}
  76. dev_t = word;
  77. {$else cpum68k}
  78. {$ifdef cpupowerpc}
  79. dev_t = cardinal;
  80. {$else cpupowerpc}
  81. {$ifdef cpusparc}
  82. dev_t = cardinal;
  83. {$else cpusparc}
  84. {$error dev_t unknown for this processor}
  85. {$endif cpusparc}
  86. {$endif cpupowerpc}
  87. {$endif cpum68k}
  88. {$endif cpui386}
  89. }{
  90. { definition of stat record type }
  91. {i stat.inc}
  92. PStat=^Stat;
  93. TStat=Stat;
  94. }
  95. {
  96. fdSet=array[0..31] of longint;{=1024 bits}
  97. pfdset=^fdset;
  98. TFDSet=fdset;
  99. timeval = packed record
  100. sec,usec:longint
  101. end;
  102. ptimeval=^timeval;
  103. TTimeVal=timeval;
  104. timespec = packed record
  105. tv_sec,tv_nsec:longint;
  106. end;
  107. timezone = packed record
  108. minuteswest,dsttime:longint;
  109. end;
  110. ptimezone =^timezone;
  111. TTimeZone = timezone;
  112. utsname = packed record
  113. sysname,
  114. nodename,
  115. release,
  116. version,
  117. machine,
  118. domainname : Array[0..64] of char;
  119. end;
  120. PUTSName=^UTSName;
  121. TUTSName=UTSName;
  122. }
  123. {
  124. $Log$
  125. Revision 1.13 2004-01-11 09:56:20 jonas
  126. * moved tstatfs from systypes.inc to ptypes.inc to fix make cycle with
  127. -dFPC_USE_LIBC (systypes.inc is now completely commented out)
  128. Revision 1.12 2003/09/14 20:15:01 marco
  129. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  130. Revision 1.11 2003/08/21 22:24:52 olle
  131. - removed parameter from fpc_iocheck
  132. Revision 1.10 2003/07/08 21:23:24 peter
  133. * sparc fixes
  134. Revision 1.9 2003/07/08 14:18:40 peter
  135. * fdset changed to 1024 bits
  136. Revision 1.8 2003/05/15 22:50:50 jonas
  137. * the stat type is processor-dependent
  138. * the dev_t tpye is processor dependent. Don't use it in the stat type
  139. however, as that one is also used at a time where dev_t is already
  140. defined as qword
  141. Revision 1.7 2002/09/07 16:01:20 peter
  142. * old logs removed and tabs fixed
  143. Revision 1.6 2002/07/29 17:50:02 florian
  144. + added register location description for ppc
  145. }