sighnd.inc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {
  2. This file is part of the Free Pascal run time library
  3. (c) 2016 the Free Pascal development team
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. Signalhandler for NetBSD/m68k
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY;without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. }
  11. CONST FPU_ALL=$7F;
  12. function getfpustate(const Sigcontext:sigcontextRec):longint; {inline;}
  13. begin
  14. getfpustate:=0;
  15. end;
  16. procedure SignalToRunerror(Signo: longint;info : PSigInfo;SigContext: PSigContextRec); public name '_FPC_DEFAULTSIGHANDLER'; cdecl;
  17. var
  18. res : word;
  19. begin
  20. res:=0;
  21. if signo = SIGFPE then
  22. begin
  23. res := 200;
  24. end
  25. else
  26. if (signo = SIGILL) or (signo = SIGBUS) or (signo = SIGSEGV) then
  27. begin
  28. res := 216;
  29. end
  30. else if (signo = SIGINT) then
  31. begin
  32. res:=217;
  33. end
  34. else if (signo = SIGKILL) then
  35. begin
  36. res:=233
  37. end;
  38. { give runtime error at the position where the signal was raised }
  39. if res<>0 then
  40. begin
  41. HandleError(res);
  42. end;
  43. end;