systypes.inc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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:
  16. %eax/%d0 : System call number
  17. %ebx/%d1 : first argument
  18. %ecx/%d2 : second argument
  19. %edx/%d3 : third argumens
  20. %esi/%d3 : fourth argument
  21. %edi/%d4 : 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 BSD updated }
  32. dirent = packed record
  33. ino : cardinal; { This is not inode number, but "a number
  34. unique for each file on a filesystem"}
  35. reclen : word;
  36. d_type,
  37. namlen : byte;
  38. name : array [0..255] of char;
  39. end;
  40. pdirent =^dirent;
  41. TDirEnt = dirent;
  42. TDir = packed record
  43. fd : integer;
  44. loc : longint;
  45. size : integer;
  46. buf : pdirent;
  47. {The following are used in libc, but NOT in the linux kernel sources ??}
  48. nextoff: longint;
  49. dd_max : integer; {size of buf. Irrelevant, as buf is of type dirent}
  50. lock : pointer;
  51. end;
  52. PDir =^TDir;
  53. {$packrecords C}
  54. Stat =record {BSD version}
  55. dev, { inode's device }
  56. ino : cardinal; { inode's number }
  57. mode, { inode protection mode }
  58. nlink : word; { number of hard links }
  59. uid, { user ID of the file's owner }
  60. gid, { group ID of the file's group }
  61. dev_t : cardinal; { device type }
  62. atime, { time of last access }
  63. atime_nsec, { nsec of last access }
  64. mtime, { time of last data modification }
  65. mtime_nsec, { nsec of last data modification }
  66. ctime, { time of last file status change }
  67. ctime_nsec : longint; { nsec of last file status change }
  68. size, { file size, in bytes }
  69. blocks : Int64; { blocks allocated for file }
  70. blksze, { optimal blocksize for I/O }
  71. flags, { user defined flags for file }
  72. filegen : cardinal; { file generation number }
  73. lspare : longint;
  74. qspare : array[0..1] of int64;
  75. end;
  76. PStat=^Stat;
  77. TStat=Stat;
  78. Statfs = packed record
  79. spare2, { place holder}
  80. bsize, { fundamental block size}
  81. iosize, { optimal block size }
  82. blocks, { total blocks}
  83. bfree, { blocks free}
  84. bavail, { block available for mortal users}
  85. files, { Total file nodes}
  86. ffree : longint; { file nodes free}
  87. fsid : array[0..1] of longint;
  88. fowner : longint; {mounter uid}
  89. ftype : longint;
  90. fflags : longint; {copy of mount flags}
  91. spare : array [0..1] of longint; { For later use }
  92. fstypename : array[0..15] of char;
  93. mountpoint : array[0..89] of char;
  94. mnfromname : array[0..89] of char;
  95. end;
  96. PStatFS=^StatFS;
  97. TStatFS=StatFS;
  98. fdSet=array[0..7] of longint;{=256 bits}
  99. pfdset=^fdset;
  100. TFDSet=fdset;
  101. timeval = packed record
  102. sec,usec:int64;
  103. end;
  104. ptimeval=^timeval;
  105. TTimeVal=timeval;
  106. timezone = packed record
  107. minuteswest,dsttime:longint;
  108. end;
  109. ptimezone =^timezone;
  110. TTimeZone = timezone;
  111. utsname = packed record
  112. sysname,
  113. nodename,
  114. release,
  115. version,
  116. machine,
  117. domainname : Array[0..64] of char;
  118. end;
  119. PUTSName=^UTSName;
  120. TUTSName=UTSName;
  121. {
  122. $Log$
  123. Revision 1.4 2000-02-04 16:55:47 marco
  124. * Fixed tdir, some params need to be 32-bit
  125. Revision 1.3 2000/02/03 17:05:55 marco
  126. * Some types fixed/ported.
  127. Revision 1.2 2000/02/02 16:45:38 marco
  128. * Typo in STAT record
  129. Revision 1.1 2000/02/02 16:36:09 marco
  130. * Initial version. Copy of linux version, with BSD stat.
  131. }