Subject: Re: lib/297: sigismember bug?
To: None <jimj@enigma.cs.uwm.edu>
From: J.T. Conklin <jconklin@netcom.com>
List: netbsd-bugs
Date: 06/20/1994 21:27:41
> >Description:
> sigismember always returns true(1)
>
> >Fix:
> The problem appears to be in the macro call. If I compile cvs with the
> macro commented out and use the function call everything appears
> to work correctly. I checked the macro call for sigismember() and
> it looks correct but possible because sigset_t is a 32bit int
> because the way the check is done it could always be true.
It's not strictly a bug, POSIX.1 gives the implementor the option of not
checking to see if the signal is in range.
Before the 4.4 signal.h file was merged, Theo had convinced me that we
should check for the bug, so I added code to check that the signal was
in range to sigsetopts.c, and I commented out the macro versions in
signal.h.
Now I'm not so sure. Most programs don't need the check, and no portable
program can depend on it.
It might be best to document the present behavior in the man page (macro
doesn't check range but the function does). Most programs would benifit
by loosing an unecessary function call. The ones that require the check
could then either #undef the macros or invoke the functions like this:
(sigismember)(set, SIGINT);
(The parens around the name inhibit macro expansion).
--jtc
------------------------------------------------------------------------------