musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/signal/sigaddset.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013年08月09日 21:25:29 -0400
committerRich Felker <dalias@aerifal.cx>2013年08月09日 21:25:29 -0400
commit76fbf6ad4bb2f697512a1541d296c1f749e3b504 (patch)
tree243dab65e7e8f30633c516330d3540ea620fc135 /src/signal/sigaddset.c
parent3c5c5e6f926feea7b823a96c2872885b100fe31f (diff)
downloadmusl-76fbf6ad4bb2f697512a1541d296c1f749e3b504.tar.gz
change sigset_t functions to restrict to _NSIG
the idea here is to avoid advertising signals that don't exist and to make these functions safe to call (e.g. from within other parts of the implementation) on fake sigset_t objects which do not have the HURD padding.
Diffstat (limited to 'src/signal/sigaddset.c')
-rw-r--r--src/signal/sigaddset.c 2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/signal/sigaddset.c b/src/signal/sigaddset.c
index edb48d1c..085d1f4a 100644
--- a/src/signal/sigaddset.c
+++ b/src/signal/sigaddset.c
@@ -4,7 +4,7 @@
int sigaddset(sigset_t *set, int sig)
{
unsigned s = sig-1;
- if (s >= 8*sizeof(sigset_t) || sig-32U<3) {
+ if (s >= _NSIG-1 || sig-32U < 3) {
errno = EINVAL;
return -1;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月08日 12:07:51 +0000

AltStyle によって変換されたページ (->オリジナル) /