signal: Use SA_SIGINFO (like glibc).
authorDanny Milosavljevic <dannym@scratchpost.org>
Thu, 4 Jul 2019 01:25:59 +0000 (03:25 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 9 Sep 2019 14:04:14 +0000 (16:04 +0200)
* lib/linux/signal.c (_restorer): Rename to...
(_restorer_for_siginfo): ...this.
(signal): Use it.  Use SA_SIGINFO.

lib/linux/signal.c

index 75352599c5c44c3a4c9cb4359484323c3378aa0b..d2f05b6f6ec527b190e5fabbf9f1157d5adca25e 100644 (file)
@@ -26,7 +26,7 @@
 #if __i386__
 #else
 void
-_restorer (void)
+_restorer_for_siginfo (void)
 {
   _sys_call (SYS_rt_sigreturn);
 }
@@ -44,12 +44,12 @@ signal (int signum, sighandler_t action)
   unsigned short itembitcount;
 
   setup_action.sa_handler = action;
-  setup_action.sa_restorer = _restorer;
+  setup_action.sa_restorer = _restorer_for_siginfo;
   bitindex = signum - 1;
   itembitcount = 8 * sizeof(setup_action.sa_mask.items[0]);
   setup_action.sa_mask.items[bitindex / itembitcount] = 1UL << (bitindex % itembitcount);
   old.sa_handler = SIG_DFL;
-  setup_action.sa_flags = SA_RESTORER | SA_RESTART;
+  setup_action.sa_flags = SA_RESTORER | SA_RESTART | SA_SIGINFO;
   int r = _sys_call4 (SYS_rt_sigaction, signum, &setup_action, &old, sizeof (sigset_t));
   if (r)
     return 0;