systypes.inc 3.7 KB

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