systypes.inc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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. { The following are records for system calls }
  33. dirent = packed record
  34. ino,
  35. off : longint;
  36. reclen : word;
  37. name : array [0..255] of char;
  38. end;
  39. pdirent =^dirent;
  40. TDirEnt = dirent;
  41. TDir = packed record
  42. fd : integer;
  43. loc : longint;
  44. size : integer;
  45. buf : pdirent;
  46. {The following are used in libc, but NOT in the linux kernel sources ??}
  47. nextoff: longint;
  48. dd_max : integer; {size of buf. Irrelevant, as buf is of type dirent}
  49. lock : pointer;
  50. end;
  51. PDir =^TDir;
  52. }
  53. { can't put definition in stat.inc because stat.inc is also included in }
  54. { bunxtype.inc, which is used together with ptypes.inc, which defines }
  55. { def_t in another way :( }
  56. {
  57. {$ifdef cpui386}
  58. dev_t = word;
  59. {$else cpui386}
  60. {$ifdef cpum68k}
  61. dev_t = word;
  62. {$else cpum68k}
  63. {$ifdef cpupowerpc}
  64. dev_t = cardinal;
  65. {$else cpupowerpc}
  66. {$ifdef cpusparc}
  67. dev_t = cardinal;
  68. {$else cpusparc}
  69. {$error dev_t unknown for this processor}
  70. {$endif cpusparc}
  71. {$endif cpupowerpc}
  72. {$endif cpum68k}
  73. {$endif cpui386}
  74. }{
  75. { definition of stat record type }
  76. {i stat.inc}
  77. PStat=^Stat;
  78. TStat=Stat;
  79. }
  80. TStatfs = packed record
  81. fstype, { File system type }
  82. bsize, { Optimal block trensfer size }
  83. blocks, { Data blocks in system }
  84. bfree, { free blocks in system }
  85. bavail, { Available free blocks to non-root users }
  86. files, { File nodes in system }
  87. ffree, { Free file nodes in system }
  88. fsid, { File system ID }
  89. namelen : longint; { Maximum name length in system }
  90. spare : array [0..6] of longint; { For later use }
  91. end;
  92. PStatFS=^TStatFS;
  93. {
  94. fdSet=array[0..31] of longint;{=1024 bits}
  95. pfdset=^fdset;
  96. TFDSet=fdset;
  97. timeval = packed record
  98. sec,usec:longint
  99. end;
  100. ptimeval=^timeval;
  101. TTimeVal=timeval;
  102. timespec = packed record
  103. tv_sec,tv_nsec:longint;
  104. end;
  105. timezone = packed record
  106. minuteswest,dsttime:longint;
  107. end;
  108. ptimezone =^timezone;
  109. TTimeZone = timezone;
  110. utsname = packed record
  111. sysname,
  112. nodename,
  113. release,
  114. version,
  115. machine,
  116. domainname : Array[0..64] of char;
  117. end;
  118. PUTSName=^UTSName;
  119. TUTSName=UTSName;
  120. }
  121. {
  122. $Log$
  123. Revision 1.12 2003-09-14 20:15:01 marco
  124. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  125. Revision 1.11 2003/08/21 22:24:52 olle
  126. - removed parameter from fpc_iocheck
  127. Revision 1.10 2003/07/08 21:23:24 peter
  128. * sparc fixes
  129. Revision 1.9 2003/07/08 14:18:40 peter
  130. * fdset changed to 1024 bits
  131. Revision 1.8 2003/05/15 22:50:50 jonas
  132. * the stat type is processor-dependent
  133. * the dev_t tpye is processor dependent. Don't use it in the stat type
  134. however, as that one is also used at a time where dev_t is already
  135. defined as qword
  136. Revision 1.7 2002/09/07 16:01:20 peter
  137. * old logs removed and tabs fixed
  138. Revision 1.6 2002/07/29 17:50:02 florian
  139. + added register location description for ppc
  140. }