ptypes.inc 3.5 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 = cuint16; { used for file attributes }
  29. TMode = mode_t;
  30. pMode = ^mode_t;
  31. nlink_t = cuint16; { 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,tv_usec:clong;
  61. end;
  62. ptimeval = ^timeval;
  63. TTimeVal = timeval;
  64. timespec = packed record
  65. tv_sec : time_t;
  66. tv_nsec : clong;
  67. end;
  68. ptimespec= ^timespec;
  69. Ttimespec= timespec;
  70. CONST
  71. { System limits, POSIX value in parentheses, used for buffer and stack allocation }
  72. ARG_MAX = 65536; {4096} { Maximum number of argument size }
  73. NAME_MAX = 255; {14} { Maximum number of bytes in filename }
  74. PATH_MAX = 1024; {255} { Maximum number of bytes in pathname }
  75. SYS_NMLN = 32; {BSD utsname struct limit}
  76. SIG_MAXSIG = 128; // highest signal version
  77. wordsinsigset = 4; // words in sigset_t
  78. {
  79. $Log$
  80. Revision 1.9 2004-01-04 20:08:45 jonas
  81. * moved SIG_MAXSIG and wordsinsigset constants from bunxtype.inc to
  82. ptypes.inc (already there for Darwin)
  83. Revision 1.8 2003/12/30 12:32:30 marco
  84. *** empty log message ***
  85. Revision 1.7 2003/09/27 13:45:58 peter
  86. * fpnanosleep exported in baseunix
  87. * fpnanosleep has pointer arguments to be C compliant
  88. Revision 1.6 2003/09/14 20:15:01 marco
  89. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  90. Revision 1.5 2003/01/03 13:11:32 marco
  91. * split into ptypes and ctypes
  92. }