system.pp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time librar~y.
  4. Copyright (c) 2000 by Marco van de Voort
  5. member of the Free Pascal development team.
  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. { These things are set in the makefile, }
  13. { But you can override them here.}
  14. { If you use an aout system, set the conditional AOUT}
  15. { $Define AOUT}
  16. Unit {$ifdef VER1_0}SysBSD{$else}System{$endif};
  17. Interface
  18. {$I sysunixh.inc}
  19. Implementation
  20. Var Errno : longint;
  21. function geterrno:longint; [public, alias: 'FPC_SYS_GETERRNO'];
  22. begin
  23. GetErrno:=Errno;
  24. end;
  25. { OS independant parts}
  26. {$I system.inc}
  27. { OS dependant parts }
  28. {$I errno.inc}
  29. {$I osposixh.inc}
  30. {$I bsdsysc.inc}
  31. {$I sysposix.inc}
  32. {$I text.inc}
  33. {$I heap.inc}
  34. {*****************************************************************************
  35. UnTyped File Handling
  36. *****************************************************************************}
  37. {$i file.inc}
  38. {*****************************************************************************
  39. Typed File Handling
  40. *****************************************************************************}
  41. {$i typefile.inc}
  42. Begin
  43. IsConsole := TRUE;
  44. IsLibrary := FALSE;
  45. StackBottom := Sptr - StackLength;
  46. { Set up signals handlers }
  47. InstallSignals;
  48. { Setup heap }
  49. InitHeap;
  50. InitExceptions;
  51. { Arguments }
  52. SetupCmdLine;
  53. { Setup stdin, stdout and stderr }
  54. OpenStdIO(Input,fmInput,StdInputHandle);
  55. OpenStdIO(Output,fmOutput,StdOutputHandle);
  56. OpenStdIO(StdOut,fmOutput,StdOutputHandle);
  57. OpenStdIO(StdErr,fmOutput,StdErrorHandle);
  58. { Reset IO Error }
  59. InOutRes:=0;
  60. {$ifdef HASVARIANT}
  61. initvariantmanager;
  62. {$endif HASVARIANT}
  63. End.
  64. {
  65. $Log$
  66. Revision 1.3 2002-10-13 09:25:39 florian
  67. + call to initvariantmanager inserted
  68. Revision 1.2 2002/09/07 16:01:17 peter
  69. * old logs removed and tabs fixed
  70. Revision 1.1 2002/08/19 12:29:11 marco
  71. * First working POSIX *BSD system unit.
  72. }