summaryrefslogtreecommitdiff
path: root/libc/signal
diff options
context:
space:
mode:
Diffstat (limited to 'libc/signal')
-rw-r--r--libc/signal/Makefile7
-rw-r--r--libc/signal/sigaddset.c32
-rw-r--r--libc/signal/sigandset.c39
-rw-r--r--libc/signal/sigblock.c65
-rw-r--r--libc/signal/sigdelset.c31
-rw-r--r--libc/signal/sigempty.c37
-rw-r--r--libc/signal/sigfillset.c18
-rw-r--r--libc/signal/siggetmask.c30
-rw-r--r--libc/signal/sighold.c42
-rw-r--r--libc/signal/sigisempty.c37
-rw-r--r--libc/signal/sigismem.c33
-rw-r--r--libc/signal/sigorset.c39
-rw-r--r--libc/signal/sigrelse.c42
-rw-r--r--libc/signal/sigsetops.c11
-rw-r--r--libc/signal/sigsetops.h34
15 files changed, 410 insertions, 87 deletions
diff --git a/libc/signal/Makefile b/libc/signal/Makefile
index fe9690cca..3f8283857 100644
--- a/libc/signal/Makefile
+++ b/libc/signal/Makefile
@@ -23,9 +23,10 @@
TOPDIR=../../
include $(TOPDIR)Rules.mak
-CSRC=bsd_sig.c raise.c sigblock.c siggtmsk.c sigjmp.c signal.c sigintr.c\
- sigpause.c sigstmsk.c sigaddset.c sigdelset.c sigismem.c \
- sigemptyset.c sigfillset.c killpg.c allocrtsig.c
+CSRC=bsd_sig.c raise.c sigblock.c siggetmask.c sigjmp.c signal.c sigintr.c\
+ sigpause.c sigstmsk.c killpg.c allocrtsig.c sigsetops.c \
+ sigaddset.c sigandset.c sigdelset.c sigfillset.c sigorset.c \
+ sigempty.c sighold.c sigisempty.c sigismem.c sigrelse.c
COBJS=$(patsubst %.c,%.o, $(CSRC))
OBJS=$(COBJS)
diff --git a/libc/signal/sigaddset.c b/libc/signal/sigaddset.c
index 8300dd7ca..be2968dba 100644
--- a/libc/signal/sigaddset.c
+++ b/libc/signal/sigaddset.c
@@ -2,31 +2,31 @@
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <stdlib.h>
-#include <errno.h>
-#include <features.h>
-#include <signal.h>
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+#include "sigsetops.h"
/* Add SIGNO to SET. */
-int sigaddset ( sigset_t *set, int signo)
+int
+sigaddset (set, signo)
+ sigset_t *set;
+ int signo;
{
- if (set == NULL || signo <= 0 || signo >= NSIG) {
- __set_errno(EINVAL);
+ if (set == NULL || signo <= 0 || signo >= NSIG)
+ {
+ __set_errno (EINVAL);
return -1;
}
diff --git a/libc/signal/sigandset.c b/libc/signal/sigandset.c
new file mode 100644
index 000000000..4e1abd969
--- /dev/null
+++ b/libc/signal/sigandset.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#define __USE_GNU
+#include <signal.h>
+#define __need_NULL
+#include <stddef.h>
+
+/* Combine sets LEFT and RIGHT by logical AND and place result in DEST. */
+int
+sigandset (dest, left, right)
+ sigset_t *dest;
+ const sigset_t *left;
+ const sigset_t *right;
+{
+ if (dest == NULL || left == NULL || right == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __sigandset (dest, left, right);
+}
diff --git a/libc/signal/sigblock.c b/libc/signal/sigblock.c
index 78d7a19be..f47b75804 100644
--- a/libc/signal/sigblock.c
+++ b/libc/signal/sigblock.c
@@ -1,45 +1,56 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 94, 95, 96, 97, 98, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
-#include <stdlib.h>
#include <errno.h>
+#define __USE_GNU
#include <signal.h>
/* Block signals in MASK, returning the old mask. */
-int sigblock (int mask)
+int sigblock (mask)
+ int mask;
{
- register int sig;
+ register unsigned int sig;
sigset_t set, oset;
- if (sigemptyset(&set) < 0)
+ if (__sigemptyset (&set) < 0)
return -1;
-
- for (sig = 1; sig < NSIG; ++sig)
- if ((mask & sigmask(sig)) && sigaddset(&set, sig) < 0)
- return -1;
- if (sigprocmask(SIG_BLOCK, &set, &oset) < 0)
+ if (sizeof (mask) == sizeof (set))
+ *(int *) &set = mask;
+ else if (sizeof (unsigned long int) == sizeof (set))
+ *(unsigned long int *) &set = (unsigned int) mask;
+ else
+ for (sig = 1; sig < NSIG && sig <= sizeof (mask) * 8; ++sig)
+ if ((mask & sigmask (sig)) && __sigaddset (&set, sig) < 0)
+ return -1;
+
+ if (sigprocmask (SIG_BLOCK, &set, &oset) < 0)
return -1;
- mask = 0;
- for (sig = 1; sig < NSIG; ++sig)
- if (sigismember(&oset, sig))
- mask |= sigmask(sig);
+ if (sizeof (mask) == sizeof (oset))
+ mask = *(int *) &oset;
+ else if (sizeof (unsigned long int) == sizeof (oset))
+ mask = *(unsigned long int*) &oset;
+ else
+ for (sig = 1, mask = 0; sig < NSIG && sig <= sizeof (mask) * 8; ++sig)
+ if (__sigismember (&oset, sig))
+ mask |= sigmask (sig);
return mask;
}
+
diff --git a/libc/signal/sigdelset.c b/libc/signal/sigdelset.c
index 6698ff6c4..7e2033188 100644
--- a/libc/signal/sigdelset.c
+++ b/libc/signal/sigdelset.c
@@ -2,30 +2,31 @@
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
-#include <stdlib.h>
-#include <errno.h>
-#include <features.h>
-#include <signal.h>
+#include "sigsetops.h"
/* Add SIGNO to SET. */
-int sigdelset ( sigset_t *set, int signo)
+int
+sigdelset (set, signo)
+ sigset_t *set;
+ int signo;
{
- if (set == NULL || signo <= 0 || signo >= NSIG) {
- __set_errno(EINVAL);
+ if (set == NULL || signo <= 0 || signo >= NSIG)
+ {
+ __set_errno (EINVAL);
return -1;
}
diff --git a/libc/signal/sigempty.c b/libc/signal/sigempty.c
new file mode 100644
index 000000000..0164ed382
--- /dev/null
+++ b/libc/signal/sigempty.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+
+/* Clear all signals from SET. */
+int
+sigemptyset (set)
+ sigset_t *set;
+{
+ if (set == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ memset (set, 0, sizeof (sigset_t));
+
+ return 0;
+}
diff --git a/libc/signal/sigfillset.c b/libc/signal/sigfillset.c
index c3ebcce4b..3126774cd 100644
--- a/libc/signal/sigfillset.c
+++ b/libc/signal/sigfillset.c
@@ -2,19 +2,19 @@
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
#include <errno.h>
#include <signal.h>
@@ -27,7 +27,7 @@ sigfillset (set)
{
if (set == NULL)
{
- __set_errno(EINVAL);
+ __set_errno (EINVAL);
return -1;
}
diff --git a/libc/signal/siggetmask.c b/libc/signal/siggetmask.c
new file mode 100644
index 000000000..cb5270ddf
--- /dev/null
+++ b/libc/signal/siggetmask.c
@@ -0,0 +1,30 @@
+/* siggetmask -- useless alias for `sigblock (0)' for old Linux compatibility.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define __USE_GNU
+#include <signal.h>
+
+int
+siggetmask (void)
+{
+ return sigblock (0);
+}
+
+link_warning (siggetmask,
+ "warning: `siggetmask' is obsolete; `sigprocmask' is best")
diff --git a/libc/signal/sighold.c b/libc/signal/sighold.c
new file mode 100644
index 000000000..f2978a368
--- /dev/null
+++ b/libc/signal/sighold.c
@@ -0,0 +1,42 @@
+/* Add SIG to the calling process' signal mask.
+ Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define __need_NULL
+#include <stddef.h>
+#define __USE_GNU
+#include <signal.h>
+
+int
+sighold (sig)
+ int sig;
+{
+ sigset_t set;
+
+ /* Retrieve current signal set. */
+ if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
+ return -1;
+
+ /* Add the specified signal. */
+ if (__sigaddset (&set, sig) < 0)
+ return -1;
+
+ /* Set the new mask. */
+ return sigprocmask (SIG_SETMASK, &set, NULL);
+}
diff --git a/libc/signal/sigisempty.c b/libc/signal/sigisempty.c
new file mode 100644
index 000000000..6d1de45a8
--- /dev/null
+++ b/libc/signal/sigisempty.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#define __USE_GNU
+#include <signal.h>
+#define __need_NULL
+#include <stddef.h>
+
+/* Test whether SET is empty. */
+int
+sigisemptyset (set)
+ const sigset_t *set;
+{
+ if (set == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __sigisemptyset (set);
+}
diff --git a/libc/signal/sigismem.c b/libc/signal/sigismem.c
index 89d88647d..0a5d6b625 100644
--- a/libc/signal/sigismem.c
+++ b/libc/signal/sigismem.c
@@ -2,32 +2,31 @@
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
-#include <stdlib.h>
-#include <errno.h>
-#include <features.h>
-#define _EXTERN_INLINE
-#define __USE_EXTERN_INLINES 1
-#include <signal.h>
+#include "sigsetops.h"
/* Return 1 if SIGNO is in SET, 0 if not. */
-int sigismember ( const sigset_t *set, int signo)
+int
+sigismember (set, signo)
+ const sigset_t *set;
+ int signo;
{
- if (set == NULL || signo <= 0 || signo >= NSIG) {
- __set_errno(EINVAL);
+ if (set == NULL || signo <= 0 || signo >= NSIG)
+ {
+ __set_errno (EINVAL);
return -1;
}
diff --git a/libc/signal/sigorset.c b/libc/signal/sigorset.c
new file mode 100644
index 000000000..ffabf3704
--- /dev/null
+++ b/libc/signal/sigorset.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <errno.h>
+#define __USE_GNU
+#include <signal.h>
+#define __need_NULL
+#include <stddef.h>
+
+/* Combine sets LEFT and RIGHT by logical OR and place result in DEST. */
+int
+sigorset (dest, left, right)
+ sigset_t *dest;
+ const sigset_t *left;
+ const sigset_t *right;
+{
+ if (dest == NULL || left == NULL || right == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ return __sigorset (dest, left, right);
+}
diff --git a/libc/signal/sigrelse.c b/libc/signal/sigrelse.c
new file mode 100644
index 000000000..725a551bc
--- /dev/null
+++ b/libc/signal/sigrelse.c
@@ -0,0 +1,42 @@
+/* Remove SIG from the calling process' signal mask.
+ Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define __need_NULL
+#include <stddef.h>
+#define __USE_GNU
+#include <signal.h>
+
+int
+sigrelse (sig)
+ int sig;
+{
+ sigset_t set;
+
+ /* Retrieve current signal set. */
+ if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
+ return -1;
+
+ /* Remove the specified signal. */
+ if (__sigdelset (&set, sig) < 0)
+ return -1;
+
+ /* Set the new mask. */
+ return sigprocmask (SIG_SETMASK, &set, NULL);
+}
diff --git a/libc/signal/sigsetops.c b/libc/signal/sigsetops.c
new file mode 100644
index 000000000..0317662a1
--- /dev/null
+++ b/libc/signal/sigsetops.c
@@ -0,0 +1,11 @@
+/* Define the real-function versions of all inline functions
+ defined in signal.h (or bits/sigset.h). */
+
+#include <features.h>
+
+#define _EXTERN_INLINE
+#ifndef __USE_EXTERN_INLINES
+# define __USE_EXTERN_INLINES 1
+#endif
+
+#include "signal.h"
diff --git a/libc/signal/sigsetops.h b/libc/signal/sigsetops.h
new file mode 100644
index 000000000..16f9b3625
--- /dev/null
+++ b/libc/signal/sigsetops.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Definitions relevant to functions that operate on `sigset_t's. */
+
+#include <errno.h>
+#define __USE_GNU
+#include <signal.h>
+#include <string.h>
+
+#define BITS (_NSIG - 1)
+#define ELT(signo) (((signo) - 1) / BITS)
+#define MASK(signo) (1 << (((signo) - 1) % BITS))
+
+#undef sigemptyset
+#undef sigfillset
+#undef sigaddset
+#undef sigdelset
+#undef sigismember