sysos.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2001 by Free Pascal development team
  4. This file implements all the base types and limits required
  5. for a minimal POSIX compliant subset required to port the compiler
  6. to a new OS.
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. {$include xbios.inc}
  14. {$include gemdos.inc}
  15. procedure Error2InOutRes(errno: longint);
  16. begin
  17. if (errno <= -2) and (errno >= -11) then
  18. InOutRes:=150-errno
  19. else
  20. begin
  21. case errno of
  22. -32 : InOutRes:=1;
  23. -33 : InOutRes:=2;
  24. -34 : InOutRes:=3;
  25. -35 : InOutRes:=4;
  26. -36 : InOutRes:=5;
  27. -37 : InOutRes:=8;
  28. -39 : InOutRes:=8;
  29. -40 : InOutRes:=9;
  30. -46 : InOutRes:=15;
  31. -67..-64 : InOutRes:=153;
  32. -15 : InOutRes:=151;
  33. -13 : InOutRes:=150;
  34. else
  35. InOutRes := word(errno);
  36. end;
  37. end;
  38. end;