signal: Add comment on why we don't use the restorer.

* lib/linux/signal.c: Add comment on why we don't use the restorer.
This commit is contained in:
Danny Milosavljevic 2019-03-14 12:22:42 +01:00 committed by Jan Nieuwenhuizen
parent ed923af631
commit 6b9c40ab22
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 10 additions and 0 deletions

View File

@ -44,6 +44,16 @@ signal (int signum, sighandler_t action)
unsigned short itembitcount;
setup_action.sa_handler = action;
/* The sa_restorer is not used. Reason:
* The kernel uses its own restorer anyway by pretending we gave one on
our side (no, really).
glibc still has a custom restorer because they want to be able to
backtrace. gdb has a second part that detects a specific instruction
sequence and then fixes up the backtrace. Since we don't use that
specific instruction sequence and also the non-siginfo restorer
is complicated (pops foreign item off the stack--so needs inline
assembly) and we don't support great debuggability in other places,
I've decided to take the easy way out for now. */
/*setup_action.sa_restorer = _restorer_for_siginfo;*/
bitindex = signum - 1;
itembitcount = 8 * sizeof(setup_action.sa_mask.items[0]);