sighnd.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 NetBSD/powerpc
  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: longint;info : PSigInfo;SigContext: PSigContextRec); public name '_FPC_DEFAULTSIGHANDLER'; 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. else if (signo = SIGINT) then
  32. begin
  33. res:=217;
  34. end
  35. else if (signo = SIGKILL) then
  36. begin
  37. res:=233
  38. end;
  39. { give runtime error at the position where the signal was raised }
  40. if res<>0 then
  41. begin
  42. HandleError(res);
  43. end;
  44. end;