aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/init.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-10-28 14:50:10 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2009-10-28 14:50:10 +0100
commit69ba91edf437188d6fb6522153903144353c0f61 (patch)
treec1b19f5264ff3f937e8799d40e5e8a7a215dfa70 /gcc/ada/init.c
parent5f3f175d79b2263927f1a4b84db71fb61a71d0e1 (diff)
downloadgcc-69ba91edf437188d6fb6522153903144353c0f61.zip
gcc-69ba91edf437188d6fb6522153903144353c0f61.tar.gz
gcc-69ba91edf437188d6fb6522153903144353c0f61.tar.bz2
[multiple changes]
2009-10-28 Robert Dewar <dewar@adacore.com> * exp_attr.adb, exp_ch9.adb, prj-nmsc.adb, tbuild.adb, ali.adb, types.ads: Minor reformatting 2009-10-28 Tristan Gingold <gingold@adacore.com> * init.c: Fix __gnat_error_handler for Darwin10 (Snow Leopard) From-SVN: r153658
Diffstat (limited to 'gcc/ada/init.c')
-rw-r--r--gcc/ada/init.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 0483d82..f9bcf63 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -2114,6 +2114,7 @@ __gnat_install_handler(void)
#elif defined(__APPLE__)
#include <signal.h>
+#include <sys/syscall.h>
#include <mach/mach_vm.h>
#include <mach/mach_init.h>
#include <mach/vm_statistics.h>
@@ -2123,9 +2124,9 @@ char __gnat_alternate_stack[32 * 1024]; /* 1 * MINSIGSTKSZ */
static void __gnat_error_handler (int sig, siginfo_t * si, void * uc);
-/* Defined in xnu unix_signal.c */
+/* Defined in xnu unix_signal.c.
+ Tell the kernel to re-use alt stack when delivering a signal. */
#define UC_RESET_ALT_STACK 0x80000000
-extern int sigreturn (void *uc, int flavour);
/* Return true if ADDR is within a stack guard area. */
static int
@@ -2173,8 +2174,9 @@ __gnat_error_handler (int sig, siginfo_t * si, void * uc ATTRIBUTE_UNUSED)
msg = "erroneous memory access";
}
/* Reset the use of alt stack, so that the alt stack will be used
- for the next signal delivery. */
- sigreturn (NULL, UC_RESET_ALT_STACK);
+ for the next signal delivery.
+ The stack can't be used in case of stack checking. */
+ syscall (SYS_sigreturn, NULL, UC_RESET_ALT_STACK);
break;
case SIGFPE: