ptypes.inc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2001 by Free Pascal development team
  4. This file implements all the base types and limits required
  5. for a minimal POSIX compliant subset required to port the compiler
  6. to a new OS.
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. {***********************************************************************}
  14. { POSIX TYPE DEFINITIONS }
  15. {***********************************************************************}
  16. {$I ctypes.inc}
  17. {$packrecords c}
  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. pthread_t = pointer;
  72. pthread_attr_t = pointer;
  73. pthread_mutex_t = {$ pmutext.inc}
  74. pthread_mutexattr_t = pointer;
  75. pthread_cond_t = pointer;
  76. pthread_condattr_t = pointer;
  77. pthread_key_t = cint;
  78. pthread_rwlock_t = pointer;
  79. pthread_rwlockattr_t = pointer;
  80. sem_t = pointer;
  81. {
  82. Mutex types (Single UNIX Specification, Version 2, 1997).
  83. Note that a mutex attribute with one of the following types:
  84. PTHREAD_MUTEX_NORMAL
  85. PTHREAD_MUTEX_RECURSIVE
  86. MUTEX_TYPE_FAST (deprecated)
  87. MUTEX_TYPE_COUNTING_FAST (deprecated)
  88. will deviate from POSIX specified semantics.
  89. }
  90. pthread_mutextype = (
  91. { Default POSIX mutex }
  92. _PTHREAD_MUTEX_ERRORCHECK := 1,
  93. { Recursive mutex }
  94. _PTHREAD_MUTEX_RECURSIVE := 2,
  95. { No error checking }
  96. _PTHREAD_MUTEX_NORMAL := 3,
  97. _MUTEX_TYPE_MAX
  98. );
  99. const
  100. _PTHREAD_MUTEX_DEFAULT = _PTHREAD_MUTEX_ERRORCHECK;
  101. _MUTEX_TYPE_FAST = _PTHREAD_MUTEX_NORMAL;
  102. _MUTEX_TYPE_COUNTING_FAST = _PTHREAD_MUTEX_RECURSIVE;
  103. _PTHREAD_KEYS_MAX = 256;
  104. _PTHREAD_STACK_MIN = 1024;
  105. { System limits, POSIX value in parentheses, used for buffer and stack allocation }
  106. ARG_MAX = 256*1024; {4096} { Maximum number of argument size }
  107. NAME_MAX = 255; {14} { Maximum number of bytes in filename }
  108. PATH_MAX = 1024; {255} { Maximum number of bytes in pathname }
  109. SYS_NMLN = 32; {BSD utsname struct limit}
  110. SIG_MAXSIG = 128; // highest signal version
  111. {
  112. $Log: ptypes.inc,v $
  113. Revision 1.9 2005/02/14 17:13:30 peter
  114. * truncate log
  115. }