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 --- nptl/pthread_kill.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nptl/pthread_kill.c') diff --git a/nptl/pthread_kill.c b/nptl/pthread_kill.c index 8015e10b70..178d38d3bd 100644 --- a/nptl/pthread_kill.c +++ b/nptl/pthread_kill.c @@ -45,8 +45,8 @@ __pthread_kill_implementation (pthread_t threadid, int signo, int no_tid) } /* Block all signals, as required by pd->exit_lock. */ - sigset_t old_mask; - __libc_signal_block_all (&old_mask); + internal_sigset_t old_mask; + internal_signal_block_all (&old_mask); __libc_lock_lock (pd->exit_lock); int ret; @@ -64,7 +64,7 @@ __pthread_kill_implementation (pthread_t threadid, int signo, int no_tid) } __libc_lock_unlock (pd->exit_lock); - __libc_signal_restore_set (&old_mask); + internal_signal_restore_set (&old_mask); return ret; } @@ -83,7 +83,7 @@ __pthread_kill (pthread_t threadid, int signo) { /* Disallow sending the signal we use for cancellation, timers, for the setxid implementation. */ - if (__is_internal_signal (signo)) + if (is_internal_signal (signo)) return EINVAL; return __pthread_kill_internal (threadid, signo); @@ -102,7 +102,7 @@ int attribute_compat_text_section __pthread_kill_esrch (pthread_t threadid, int signo) { - if (__is_internal_signal (signo)) + if (is_internal_signal (signo)) return EINVAL; return __pthread_kill_implementation (threadid, signo, ESRCH); -- cgit v1.2.3-70-g09d2