ptypes.inc 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. { Introduced defines
  18. - 64bitarch (for 64-bits Linux systems, test system was idefix (in ctypes)
  19. - 64bitfs (should be on if libc switches to a 64-bit system.
  20. All three tested systems (PPC,Alpha,2x i386) gave the same POSIX limits,
  21. and all three 32-bit systems returned completely identical types too
  22. (everything 32-bit except dev_t, which is assumed to be a result of devfs
  23. introduction)
  24. }
  25. {$I ctypes.inc}
  26. Type
  27. {$ifndef VER_1_0}
  28. dev_t = cuint64; { used for device numbers }
  29. {$else}
  30. dev_t = int64;
  31. {$endif}
  32. gid_t = cuint32; { used for group IDs }
  33. ino_t = clong; { used for file serial numbers }
  34. mode_t = cuint32; { used for file attributes }
  35. nlink_t = cuint32; { used for link counts }
  36. {$ifdef 64BitArch}
  37. off_t = cint64; { used for file sizes }
  38. {$else}
  39. {$ifdef 64BitFS}
  40. off_t = cint64;
  41. {$else}
  42. off_t = cint;
  43. pid_t = cint32; { used as process identifier }
  44. {$endif}
  45. {$endif}
  46. {$ifdef 64bitarch}
  47. size_t = cuint64; { as definied in the C standard}
  48. ssize_t = cint64; { used by function for returning number of bytes }
  49. {$else}
  50. size_t = cuint32; { as definied in the C standard}
  51. ssize_t = cint32; { used by function for returning number of bytes }
  52. {$endif}
  53. uid_t = cuint32; { used for user ID type }
  54. {$ifdef 64bitarch}
  55. clock_t = cuint64;
  56. time_t = cint64; { used for returning the time }
  57. {$else}
  58. clock_t = culong;
  59. time_t = clong; { used for returning the time }
  60. {$endif}
  61. ptime_t = ^time_t;
  62. socklen_t= cuint32;
  63. CONST
  64. { System limits, POSIX value in parentheses, used for buffer and stack allocation }
  65. { took idefix' values}
  66. ARG_MAX = 131072; {4096} { Maximum number of argument size }
  67. NAME_MAX = 255; {14} { Maximum number of bytes in filename }
  68. PATH_MAX = 4095; {255} { Maximum number of bytes in pathname }
  69. {
  70. $Log$
  71. Revision 1.2 2002-11-12 14:28:40 marco
  72. * some updates
  73. Revision 1.1 2002/10/29 16:47:17 marco
  74. * Linux versions
  75. }