sighnd.inc 999 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {
  2. This file is part of the Free Pascal run time library.
  3. (c) 2000-2003 by Marco van de Voort
  4. member of the Free Pascal development team.
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. Signalhandler for FreeBSD/i386
  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. CONST FPU_ALL=$7F;
  13. function getfpustate(const Sigcontext:sigcontextRec):longint; {inline;}
  14. begin
  15. getfpustate:=0;
  16. end;
  17. procedure SignalToRunerror(signo: cint); cdecl;
  18. var
  19. res : word;
  20. begin
  21. res:=0;
  22. if signo = SIGFPE then
  23. begin
  24. res := 200;
  25. end
  26. else
  27. if (signo = SIGILL) or (signo = SIGBUS) or (signo = SIGSEGV) then
  28. begin
  29. res := 216;
  30. end;
  31. { give runtime error at the position where the signal was raised }
  32. if res<>0 then
  33. begin
  34. HandleError(res);
  35. end;
  36. end;