ptypes.inc 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2001 by Free Pascal development team
  5. This file implements all the base types and limits required
  6. for a minimal POSIX compliant subset required to port the compiler
  7. to a new OS.
  8. See the file COPYING.FPC, included in this distribution,
  9. for details about the copyright.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. **********************************************************************}
  14. {***********************************************************************}
  15. { POSIX TYPE DEFINITIONS }
  16. {***********************************************************************}
  17. {$i ctypes.inc}
  18. type
  19. { the following type definitions are compiler dependant }
  20. { and system dependant }
  21. dev_t = cuint32; { used for device numbers }
  22. TDev = dev_t;
  23. pDev = ^dev_t;
  24. gid_t = cuint32; { used for group IDs }
  25. TGid = gid_t;
  26. pGid = ^gid_t;
  27. ino_t = clong; { used for file serial numbers }
  28. TIno = ino_t;
  29. pIno = ^ino_t;
  30. mode_t = cuint16; { used for file attributes }
  31. TMode = mode_t;
  32. pMode = ^mode_t;
  33. nlink_t = cuint16; { used for link counts }
  34. TnLink = nlink_t;
  35. pnLink = ^nlink_t;
  36. off_t = cint64; { used for file sizes }
  37. TOff = off_t;
  38. pOff = ^off_t;
  39. pid_t = cint32; { used as process identifier }
  40. TPid = pid_t;
  41. pPid = ^pid_t;
  42. size_t = cuint32; { as definied in the C standard}
  43. TSize = size_t;
  44. pSize = ^size_t;
  45. ssize_t = cint32; { used by function for returning number of bytes }
  46. TsSize = ssize_t;
  47. psSize = ^ssize_t;
  48. uid_t = cuint32; { used for user ID type }
  49. TUid = Uid_t;
  50. pUid = ^Uid_t;
  51. clock_t = culong;
  52. TClock = clock_t;
  53. pClock = ^clock_t;
  54. time_t = clong; { used for returning the time }
  55. TTime = time_t;
  56. pTime = ^time_t;
  57. ptime_t = ^time_t;
  58. socklen_t= cuint32;
  59. TSocklen = socklen_t;
  60. pSocklen = ^socklen_t;
  61. timeval = record
  62. tv_sec: cint;
  63. tv_usec: cint;
  64. end;
  65. ptimeval = ^timeval;
  66. TTimeVal = timeval;
  67. timespec = packed record
  68. tv_sec : time_t;
  69. tv_nsec : clong;
  70. end;
  71. ptimespec= ^timespec;
  72. Ttimespec= timespec;
  73. CONST
  74. { System limits, POSIX value in parentheses, used for buffer and stack allocation }
  75. ARG_MAX = 65536; {4096} { Maximum number of argument size }
  76. NAME_MAX = 255; {14} { Maximum number of bytes in filename }
  77. PATH_MAX = 1024; {255} { Maximum number of bytes in pathname }
  78. SYS_NMLN = 32; {BSD utsname struct limit}
  79. SIG_MAXSIG = 32; // highest signal version
  80. wordsinsigset = 1; // words in sigset_t
  81. MFSNAMELEN = 15;
  82. MNAMELEN = 90;
  83. type
  84. fsid_t = record
  85. val: array[0..1] of cint32;
  86. end;
  87. tstatfs = record
  88. otype : cint16;
  89. oflags : cint16;
  90. bsize : cint32;
  91. iosize : cint32;
  92. blocks : cint32;
  93. bfree : cint32;
  94. bavail : cint32;
  95. files : cint32;
  96. ffree : cint32;
  97. fsid : fsid_t;
  98. fowner : uid_t;
  99. reserved1 : cint16;
  100. ftype : cint16;
  101. fflags : cint32;
  102. reserved2 : array[0..1] of cint32;
  103. fstypename : array[0..(MFSNAMELEN)-1] of char;
  104. mountpoint : array[0..(MNAMELEN)-1] of char;
  105. mntfromname : array[0..(MNAMELEN)-1] of char;
  106. end;
  107. pstatfs = ^tstatfs;
  108. {
  109. $Log$
  110. Revision 1.3 2004-01-04 20:05:38 jonas
  111. * first working version of the Darwin/Mac OS X (for PowerPC) RTL
  112. Several non-essential units are still missing, but make cycle works
  113. Revision 1.2 2003/05/25 12:59:57 jonas
  114. * several fixes, addition of Mach trap numbers (thye are simply syscalls
  115. with a negative number)
  116. Revision 1.1 2002/09/08 09:00:54 jonas
  117. + initial revision, simply copied from FreeBSD
  118. }