summaryrefslogtreecommitdiff
path: root/lang/gnat/files/patch-ai
diff options
context:
space:
mode:
Diffstat (limited to 'lang/gnat/files/patch-ai')
-rw-r--r--lang/gnat/files/patch-ai84
1 files changed, 84 insertions, 0 deletions
diff --git a/lang/gnat/files/patch-ai b/lang/gnat/files/patch-ai
new file mode 100644
index 000000000000..0e6593362a79
--- /dev/null
+++ b/lang/gnat/files/patch-ai
@@ -0,0 +1,84 @@
+*** ./ada/a-init.c.orig Fri Sep 24 08:42:43 1999
+--- ./ada/a-init.c Sat Nov 6 16:22:51 1999
+***************
+*** 1445,1450 ****
+--- 1445,1523 ----
+ }
+
+
++ /*************************************************/
++ /* __gnat_initialize (FreeBSD version) */
++ /*************************************************/
++
++ #elif defined (__FreeBSD__)
++
++ #include <signal.h>
++ #include <unistd.h>
++
++ static void
++ __gnat_error_handler (sig, code, sc)
++ int sig;
++ int code;
++ struct sigcontext *sc;
++ {
++ struct Exception_Data *exception;
++ char *msg;
++
++ switch (sig)
++ {
++ case SIGFPE:
++ exception = &constraint_error;
++ msg = "SIGFPE";
++ break;
++
++ case SIGILL:
++ exception = &constraint_error;
++ msg = "SIGILL";
++ break;
++
++ case SIGSEGV:
++ exception = &storage_error;
++ msg = "stack overflow or erroneous memory access";
++ break;
++
++ case SIGBUS:
++ exception = &constraint_error;
++ msg = "SIGBUS";
++ break;
++
++ default:
++ exception = &program_error;
++ msg = "unhandled signal";
++ }
++
++ Raise_From_Signal_Handler (exception, msg);
++ }
++
++ static void
++ __gnat_install_handler ()
++ {
++ struct sigaction act;
++
++ /* Set up signal handler to map synchronous signals to appropriate
++ exceptions. Make sure that the handler isn't interrupted by another
++ signal that might cause a scheduling event! */
++
++ act.sa_handler = __gnat_error_handler;
++ act.sa_flags = SA_NODEFER | SA_RESTART;
++ (void) sigemptyset (&act.sa_mask);
++
++ (void) sigaction (SIGILL, &act, NULL);
++ (void) sigaction (SIGFPE, &act, NULL);
++ (void) sigaction (SIGSEGV, &act, NULL);
++ (void) sigaction (SIGBUS, &act, NULL);
++ }
++
++ void
++ __gnat_initialize ()
++ {
++ __gnat_install_handler ();
++ }
++
+ /***************************************/
+ /* __gnat_initialize (default version) */
+ /***************************************/