about summary refs log tree commit diff
path: root/signal
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-04-21 09:41:59 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-06-30 14:56:21 -0300
commita1bdd81664aa681364da368154c48501db249df9 (patch)
tree29f01a9ad8bcda2794869dd0555537a2de16fa38 /signal
parentc22d2021a9f9bdea62398976eea4f0e6ef668b7d (diff)
downloadglibc-a1bdd81664aa681364da368154c48501db249df9.tar.gz
glibc-a1bdd81664aa681364da368154c48501db249df9.tar.xz
glibc-a1bdd81664aa681364da368154c48501db249df9.zip
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 <arjun@redhat.com>
Diffstat (limited to 'signal')
-rw-r--r--signal/sigaction.c2
-rw-r--r--signal/sigaddset.c2
-rw-r--r--signal/sigdelset.c2
-rw-r--r--signal/sigfillset.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/signal/sigaction.c b/signal/sigaction.c
index 8e94b9a10b..d56b3196ca 100644
--- a/signal/sigaction.c
+++ b/signal/sigaction.c
@@ -24,7 +24,7 @@
 int
 __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
-  if (sig <= 0 || sig >= NSIG || __is_internal_signal (sig))
+  if (sig <= 0 || sig >= NSIG || is_internal_signal (sig))
     {
       __set_errno (EINVAL);
       return -1;
diff --git a/signal/sigaddset.c b/signal/sigaddset.c
index c6ef0a953a..f0fed84dd7 100644
--- a/signal/sigaddset.c
+++ b/signal/sigaddset.c
@@ -25,7 +25,7 @@ int
 sigaddset (sigset_t *set, int signo)
 {
   if (set == NULL || signo <= 0 || signo >= NSIG
-      || __is_internal_signal (signo))
+      || is_internal_signal (signo))
     {
       __set_errno (EINVAL);
       return -1;
diff --git a/signal/sigdelset.c b/signal/sigdelset.c
index 81bb9a908a..2c973c9b84 100644
--- a/signal/sigdelset.c
+++ b/signal/sigdelset.c
@@ -25,7 +25,7 @@ int
 sigdelset (sigset_t *set, int signo)
 {
   if (set == NULL || signo <= 0 || signo >= NSIG
-      || __is_internal_signal (signo))
+      || is_internal_signal (signo))
     {
       __set_errno (EINVAL);
       return -1;
diff --git a/signal/sigfillset.c b/signal/sigfillset.c
index b52ef06aa0..1d11ae4fec 100644
--- a/signal/sigfillset.c
+++ b/signal/sigfillset.c
@@ -31,7 +31,7 @@ sigfillset (sigset_t *set)
     }
 
   __sigfillset (set);
-  __clear_internal_signals (set);
+  clear_internal_signals (set);
   return 0;
 }
 libc_hidden_def (sigfillset)