sighnd.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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/arm
  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 signal_trampoline; cdecl;
  17. begin
  18. {$WARNING fix me! - signal trampoline}
  19. end;
  20. procedure SignalToRunerror(Signo: longint;info : PSigInfo;SigContext: PSigContextRec); public name '_FPC_DEFAULTSIGHANDLER'; cdecl;
  21. var
  22. res : word;
  23. begin
  24. res:=0;
  25. if signo = SIGFPE then
  26. begin
  27. res := 200;
  28. end
  29. else
  30. if (signo = SIGILL) or (signo = SIGBUS) or (signo = SIGSEGV) then
  31. begin
  32. res := 216;
  33. end
  34. else if (signo = SIGINT) then
  35. begin
  36. res:=217;
  37. end
  38. else if (signo = SIGKILL) then
  39. begin
  40. res:=233
  41. end;
  42. { give runtime error at the position where the signal was raised }
  43. if res<>0 then
  44. begin
  45. HandleError(res);
  46. end;
  47. end;