From nobody  Sat May 17 23:34:19 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.5/8.8.5) id XAA13495;
          Sat, 17 May 1997 23:34:19 -0700 (PDT)
Message-Id: <199705180634.XAA13495@hub.freebsd.org>
Date: Sat, 17 May 1997 23:34:19 -0700 (PDT)
From: nw1@cs.wustl.edu
To: freebsd-gnats-submit@freebsd.org
Subject: Error in /usr/src/lib/libc/gen/sigsetops.c
X-Send-Pr-Version: www-1.0

>Number:         3615
>Category:       misc
>Synopsis:       Error in /usr/src/lib/libc/gen/sigsetops.c
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 17 23:40:01 PDT 1997
>Closed-Date:    Fri Nov 21 15:18:14 PST 1997
>Last-Modified:  Fri Nov 21 15:18:53 PST 1997
>Originator:     Nanbor Wang
>Release:        3.0-current
>Organization:
Washington University
>Environment:
FreeBSD number.wustl.edu 3.0-CURRENT FreeBSD 3.0-CURRENT #0: Wed Feb 26 00:22:44 CST 1997     root@number.wustl.edu:/usr/src/sys/compile/EXTRA_SLOW_PENTIUM  i386

>Description:
In file /usr/src/lib/libc/gen/sigsetops.c, the sigismember() is implemented as:

int
sigismember(set, signo)
        const sigset_t *set;
        int signo;
{
        return ((*set & ~sigmask(signo)) != 0);
}

Which is not correct.  (In /usr/include/signal.h, if _ANSI_SOURCE is defined,
it is defined as:

#define sigismember(set, signo) ((*(set) & (1 << ((signo) - 1))) != 0)

This is correct.)

>How-To-Repeat:
Try play with it and you know.  I have compared it with Solaris's behaviors
and am absolutely sure this is a bug.

>Fix:
int
sigismember(set, signo)
        const sigset_t *set;
        int signo;
{
        return ((*set & sigmask(signo)) != 0);
}

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jraynard 
State-Changed-When: Fri Nov 21 15:18:14 PST 1997 
State-Changed-Why:  
Fixed, thanks. 
>Unformatted:
