From a1bdd81664aa681364da368154c48501db249df9 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 21 Apr 2022 09:41:59 -0300 Subject: Refactor internal-signals.h The main drive is to optimize the internal usage and required size when sigset_t is embedded in other data structures. On Linux, the current supported signal set requires up to 8 bytes (16 on mips), was lower than the user defined sigset_t (128 bytes). A new internal type internal_sigset_t is added, along with the functions to operate on it similar to the ones for sigset_t. The internal-signals.h is also refactored to remove unused functions Besides small stack usage on some functions (posix_spawn, abort) it lower the struct pthread by about 120 bytes (112 on mips). Checked on x86_64-linux-gnu. Reviewed-by: Arjun Shankar --- stdlib/abort.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'stdlib') diff --git a/stdlib/abort.c b/stdlib/abort.c index bcf72f9356..9c1065af0e 100644 --- a/stdlib/abort.c +++ b/stdlib/abort.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include /* Try to get a machine dependent instruction which will make the program crash. This is used in case everything else fails. */ @@ -48,7 +48,6 @@ void abort (void) { struct sigaction act; - sigset_t sigs; /* First acquire the lock. */ __libc_lock_lock_recursive (lock); @@ -59,9 +58,10 @@ abort (void) if (stage == 0) { ++stage; - __sigemptyset (&sigs); - __sigaddset (&sigs, SIGABRT); - __sigprocmask (SIG_UNBLOCK, &sigs, 0); + internal_sigset_t sigs; + internal_sigemptyset (&sigs); + internal_sigaddset (&sigs, SIGABRT); + internal_sigprocmask (SIG_UNBLOCK, &sigs, NULL); } /* Send signal which possibly calls a user handler. */ -- cgit 1.4.1