system.pp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. End.
  61. {
  62. $Log$
  63. Revision 1.2 2002-09-07 16:01:17 peter
  64. * old logs removed and tabs fixed
  65. Revision 1.1 2002/08/19 12:29:11 marco
  66. * First working POSIX *BSD system unit.
  67. }