aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2011-07-22 08:53:01 +0000
committerRainer Orth <ro@gcc.gnu.org>2011-07-22 08:53:01 +0000
commit94017021b1c6372bd66c6aad2044a2a3d41f81f5 (patch)
treeb854f6cbb1172b38e2b25d9fb4be6d805135cecf
parent7e2fe4887e4a8c2947a1990b2fa3ba1fc70607a3 (diff)
downloadgcc-94017021b1c6372bd66c6aad2044a2a3d41f81f5.zip
gcc-94017021b1c6372bd66c6aad2044a2a3d41f81f5.tar.gz
gcc-94017021b1c6372bd66c6aad2044a2a3d41f81f5.tar.bz2
init.c [sgi] (__gnat_error_handler): Update sigaction(2) citation.
* init.c [sgi] (__gnat_error_handler): Update sigaction(2) citation. Correct argument types. Extract code from reason. (__gnat_install_handler): Assign to act.sa_sigaction. From-SVN: r176619
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/init.c31
2 files changed, 30 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1a616a5..27f4169 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * init.c [sgi] (__gnat_error_handler): Update sigaction(2) citation.
+ Correct argument types.
+ Extract code from reason.
+ (__gnat_install_handler): Assign to act.sa_sigaction.
+
2011-07-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/Make-lang.in (GNAT1_ADA_OBJS): Move ada/b_gnat1.o to...
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index 888ec20..2dc4aa5 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -763,16 +763,31 @@ extern struct Exception_Data _abort_signal;
connecting that handler, with the effects described in the sigaction
man page:
- SA_SIGINFO [...]
- If cleared and the signal is caught, the first argument is
- also the signal number but the second argument is the signal
- code identifying the cause of the signal. The third argument
- points to a sigcontext_t structure containing the receiving
- process's context when the signal was delivered. */
+ SA_SIGINFO If set and the signal is caught, sig is passed as the
+ first argument to the signal-catching function. If the
+ second argument is not equal to NULL, it points to a
+ siginfo_t structure containing the reason why the
+ signal was generated [see siginfo(5)]; the third
+ argument points to a ucontext_t structure containing
+ the receiving process's context when the signal was
+ delivered [see ucontext(5)]. If cleared and the signal
+ is caught, the first argument is also the signal number
+ but the second argument is the signal code identifying
+ the cause of the signal. The third argument points to a
+ sigcontext_t structure containing the receiving
+ process's context when the signal was delivered. This
+ is the default behavior (see signal(5) for more
+ details). Additionally, when SA_SIGINFO is set for a
+ signal, multiple occurrences of that signal will be
+ queued for delivery in FIFO order (see sigqueue(3) for
+ a more detailed explanation of this concept), if those
+ occurrences of that signal were generated using
+ sigqueue(3). */
static void
-__gnat_error_handler (int sig, int code, sigcontext_t *sc ATTRIBUTE_UNUSED)
+__gnat_error_handler (int sig, siginfo_t *reason, void *uc ATTRIBUTE_UNUSED)
{
+ int code = reason == NULL ? 0 : reason->si_code;
struct Exception_Data *exception;
const char *msg;
@@ -859,7 +874,7 @@ __gnat_install_handler (void)
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_sigaction = __gnat_error_handler;
act.sa_flags = SA_NODEFER + SA_RESTART;
sigfillset (&act.sa_mask);
sigemptyset (&act.sa_mask);