summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/sigsetops.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>1999-10-02 19:37:14 +0000
committermarcel <marcel@FreeBSD.org>1999-10-02 19:37:14 +0000
commit2e11ef172bf42336aba190723ff7f63246b23098 (patch)
tree2092955018361aaaced247521cea7b1b0afd1a80 /lib/libc/gen/sigsetops.c
parent0611a8a3a0777ec31a9c7459ac060137decb8f8f (diff)
downloadFreeBSD-src-2e11ef172bf42336aba190723ff7f63246b23098.zip
FreeBSD-src-2e11ef172bf42336aba190723ff7f63246b23098.tar.gz
o Add $FreeBSD$ as a rcsid instead of in a comment
o Remove bitrotted #undef directives o Actually set errno now and order the functions Submitted by: bde
Diffstat (limited to 'lib/libc/gen/sigsetops.c')
-rw-r--r--lib/libc/gen/sigsetops.c59
1 files changed, 28 insertions, 31 deletions
diff --git a/lib/libc/gen/sigsetops.c b/lib/libc/gen/sigsetops.c
index 7206b7a..ffba20c 100644
--- a/lib/libc/gen/sigsetops.c
+++ b/lib/libc/gen/sigsetops.c
@@ -31,69 +31,66 @@
* SUCH DAMAGE.
*
* @(#)sigsetops.c 8.1 (Berkeley) 6/4/93
- *
- * $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
+#if 0
static char sccsid[] = "@(#)sigsetops.c 8.1 (Berkeley) 6/4/93";
+#endif
+static const char rcsid[] =
+ "$FreeBSD$";
#endif /* LIBC_SCCS and not lint */
+#include <errno.h>
#include <signal.h>
-#undef sigemptyset
-#undef sigfillset
-#undef sigaddset
-#undef sigdelset
-#undef sigismember
-
int
-sigemptyset(set)
+sigaddset(set, signo)
sigset_t *set;
+ int signo;
{
- int i;
- for (i = 0; i < _SIG_WORDS; i++)
- set->__bits[i] = 0;
+ if (signo <= 0 || signo > _SIG_MAXSIG) {
+ errno = EINVAL;
+ return (-1);
+ }
+ set->__bits[_SIG_WORD(signo)] |= _SIG_BIT(signo);
return (0);
}
int
-sigfillset(set)
+sigdelset(set, signo)
sigset_t *set;
+ int signo;
{
- int i;
- for (i = 0; i < _SIG_WORDS; i++)
- set->__bits[i] = ~(unsigned int)0;
+ if (signo <= 0 || signo > _SIG_MAXSIG) {
+ errno = EINVAL;
+ return (-1);
+ }
+ set->__bits[_SIG_WORD(signo)] &= ~_SIG_BIT(signo);
return (0);
}
int
-sigaddset(set, signo)
+sigemptyset(set)
sigset_t *set;
- int signo;
{
+ int i;
- if (signo <= 0 || signo > _SIG_MAXSIG) {
- /* errno = EINVAL; */
- return (-1);
- }
- set->__bits[_SIG_WORD(signo)] |= _SIG_BIT(signo);
+ for (i = 0; i < _SIG_WORDS; i++)
+ set->__bits[i] = 0;
return (0);
}
int
-sigdelset(set, signo)
+sigfillset(set)
sigset_t *set;
- int signo;
{
+ int i;
- if (signo <= 0 || signo > _SIG_MAXSIG) {
- /* errno = EINVAL; */
- return (-1);
- }
- set->__bits[_SIG_WORD(signo)] &= ~_SIG_BIT(signo);
+ for (i = 0; i < _SIG_WORDS; i++)
+ set->__bits[i] = ~0U;
return (0);
}
@@ -104,7 +101,7 @@ sigismember(set, signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
- /* errno = EINVAL; */
+ errno = EINVAL;
return (-1);
}
return ((set->__bits[_SIG_WORD(signo)] & _SIG_BIT(signo)) ? 1 : 0);
OpenPOWER on IntegriCloud