baseunix.pp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2001 by Carl Eric Codere development team
  4. Base Unix unit modelled after POSIX 2001.
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. Unit BaseUnix;
  12. Interface
  13. {$inline on}
  14. Uses UnixType;
  15. {$i osdefs.inc} { Compile time defines }
  16. {$i aliasptp.inc}
  17. {$packrecords C}
  18. {$ifndef FPC_USE_LIBC}
  19. {$define FPC_USE_SYSCALL}
  20. {$endif}
  21. {$i errno.inc} { Error numbers }
  22. {$i ostypes.inc}
  23. {$ifdef FPC_USE_LIBC}
  24. const clib = 'c';
  25. {$define FPC_IN_BASEUNIX}
  26. {$i oscdeclh.inc}
  27. {$ELSE}
  28. {$i bunxh.inc} { Functions}
  29. {$ENDIF}
  30. function fpgeterrno:longint; external name 'FPC_SYS_GETERRNO';
  31. procedure fpseterrno(err:longint); external name 'FPC_SYS_SETERRNO';
  32. property errno : cint read fpgeterrno write fpseterrno;
  33. {$i bunxovlh.inc}
  34. implementation
  35. {$ifdef hassysctl}
  36. Uses Sysctl;
  37. {$endif}
  38. {$i genfuncs.inc} // generic calls. (like getenv)
  39. {$I gensigset.inc} // general sigset funcs implementation.
  40. {$I genfdset.inc} // general fdset funcs.
  41. {$ifndef FPC_USE_LIBC}
  42. {$i syscallh.inc} // do_syscall declarations themselves
  43. {$i sysnr.inc} // syscall numbers.
  44. {$i bsyscall.inc} // cpu specific syscalls
  45. {$i bunxsysc.inc} // syscalls in system unit.
  46. {$i settimeo.inc}
  47. {$endif}
  48. {$i osmacro.inc} { macro implenenations }
  49. {$i bunxovl.inc} { redefs and overloads implementation }
  50. end.