baseunix.pp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2001 by Carl Eric Codere development team
  5. Base Unix unit modelled after POSIX 2001.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. Unit BaseUnix;
  13. Interface
  14. {$define oldreaddir} // Keep using readdir system call instead
  15. // of userland getdents stuff.
  16. {$define usedomain} // Allow uname with "domain" entry.
  17. // (which is a GNU extension)
  18. {$define posixworkaround} // Temporary ugly workaround for signal handler.
  19. // (mainly until baseunix migration is complete)
  20. {$ifndef FPC_USE_LIBC}
  21. {$define FPC_USE_SYSCALL}
  22. {$endif}
  23. {$i errno.inc} { Error numbers }
  24. {$i bunxtype.inc} { Types }
  25. {$ifdef FPC_USE_LIBC}
  26. {$i oscdeclh.inc}
  27. {$ELSE}
  28. {$i bunxh.inc} { Functions}
  29. {$ENDIF}
  30. {$i bunxovlh.inc}
  31. function fpgeterrno:longint;
  32. procedure fpseterrno(err:longint);
  33. {$ifdef HASGLOBALPROPERTY}
  34. property errno : cint read fpgeterrno write fpseterrno;
  35. {$endif}
  36. implementation
  37. {$i bunxmain.inc} { implementation}
  38. {$i bunxovl.inc} { redefs and overloads implementation}
  39. {$ifdef ver1_0}
  40. // MvdV 1.0 is buggy in calling externals it seems. dunno what exactly
  41. function intfpgeterrno:longint; external name 'FPC_SYS_GETERRNO';
  42. procedure intfpseterrno(err:longint); external name 'FPC_SYS_SETERRNO';
  43. function fpgeterrno:longint;
  44. begin
  45. fpgeterrno:=intfpgeterrno;
  46. end;
  47. procedure fpseterrno(err:longint);
  48. begin
  49. intfpseterrno(err);
  50. end;
  51. {$else}
  52. function fpgeterrno:longint; external name 'FPC_SYS_GETERRNO';
  53. procedure fpseterrno(err:longint); external name 'FPC_SYS_SETERRNO';
  54. {$endif}
  55. end.
  56. {
  57. $Log$
  58. Revision 1.7 2003-12-31 20:01:00 marco
  59. * workaround for buggy 1.0 building
  60. Revision 1.6 2003/12/30 12:36:56 marco
  61. * FPC_USE_LIBC
  62. Revision 1.5 2003/12/11 18:20:50 florian
  63. * replaced VER1_0 by HASGLOBALPROPERTY
  64. Revision 1.4 2003/12/10 17:14:06 marco
  65. * property support under ifndef ver1_0
  66. Revision 1.3 2003/12/10 17:08:28 marco
  67. * property errno defined
  68. Revision 1.2 2003/09/14 20:15:01 marco
  69. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  70. Revision 1.1 2002/12/18 16:44:09 marco
  71. * more new RTL
  72. Revision 1.2 2002/11/14 12:17:28 marco
  73. * for now.
  74. }