ptypes.inc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. dev_t = cuint32; { used for device numbers }
  20. TDev = dev_t;
  21. pDev = ^dev_t;
  22. gid_t = cuint32; { used for group IDs }
  23. TGid = gid_t;
  24. pGid = ^gid_t;
  25. ino_t = clong; { used for file serial numbers }
  26. TIno = ino_t;
  27. pIno = ^ino_t;
  28. mode_t = cuint32; { used for file attributes }
  29. TMode = mode_t;
  30. pMode = ^mode_t;
  31. nlink_t = cuint32; { used for link counts }
  32. TnLink = nlink_t;
  33. pnLink = ^nlink_t;
  34. off_t = cint64; { used for file sizes }
  35. TOff = off_t;
  36. pOff = ^off_t;
  37. pid_t = cint32; { used as process identifier }
  38. TPid = pid_t;
  39. pPid = ^pid_t;
  40. size_t = cuint32; { as definied in the C standard}
  41. TSize = size_t;
  42. pSize = ^size_t;
  43. ssize_t = cint32; { used by function for returning number of bytes }
  44. TsSize = ssize_t;
  45. psSize = ^ssize_t;
  46. uid_t = cuint32; { used for user ID type }
  47. TUid = Uid_t;
  48. pUid = ^Uid_t;
  49. clock_t = culong;
  50. TClock = clock_t;
  51. pClock = ^clock_t;
  52. time_t = clong; { used for returning the time }
  53. TTime = time_t;
  54. pTime = ^time_t;
  55. ptime_t = ^time_t;
  56. socklen_t= cuint32;
  57. TSocklen = socklen_t;
  58. pSocklen = ^socklen_t;
  59. timeval = packed record
  60. tv_sec,
  61. tv_usec : clong;
  62. end;
  63. ptimeval= ^timeval;
  64. TTimeval= timeval;
  65. timespec = packed record
  66. tv_sec : time_t;
  67. tv_nsec : clong;
  68. end;
  69. ptimespec= ^timespec;
  70. Ttimespec= timespec;
  71. CONST
  72. { System limits, POSIX value in parentheses, used for buffer and stack allocation }
  73. ARG_MAX = 256*1024; {4096} { Maximum number of argument size }
  74. NAME_MAX = 255; {14} { Maximum number of bytes in filename }
  75. PATH_MAX = 1024; {255} { Maximum number of bytes in pathname }
  76. SYS_NMLN = 32; {BSD utsname struct limit}
  77. SIG_MAXSIG = 128; // highest signal version
  78. wordsinsigset = 4; // words in sigset_t
  79. {
  80. $Log$
  81. Revision 1.4 2004-01-22 13:46:14 marco
  82. bsd
  83. Revision 1.5 2004/01/04 20:08:45 jonas
  84. * moved SIG_MAXSIG and wordsinsigset constants from bunxtype.inc to
  85. ptypes.inc (already there for Darwin)
  86. Revision 1.4 2004/01/04 01:11:28 marco
  87. * a new qod port of the freebsd rtl. To be refined in the coming days.
  88. Revision 1.3 2003/01/17 22:13:47 marco
  89. * some updates
  90. Revision 1.5 2003/01/03 13:11:32 marco
  91. * split into ptypes and ctypes
  92. }