From: H.J. Lu (hlu@eecs.wsu.edu)
Date: 10/21/92


From: hlu@eecs.wsu.edu (H.J. Lu)
Subject: Re: sigmask bug in /usr/include/signal.h (SLS 0.98, wherever it got it from)
Date: Thu, 22 Oct 1992 03:15:39 GMT

In article <EICHIN.92Oct21200839@tsx-11.mit.edu>, eichin@athena.mit.edu (Mark W. Eichin) writes:
|> >> How about
|> >> #define __sigmask(sig) (((sig) > 32 || (sig) < 1) ? 0 : (1 << ((sig) - 1)))
|>
|> Oh, right, sig can go from 1..32 not 0..31. Sure, that's fine. (Does
|> Linus release /usr/include with the kernel, or is that someone else's
|> "project"?)
|>

It's me. I have fixed it in the upcoming libc 4.2.

|> >>I would call it a bug in CVS. How do you handle __sigmask(0) or __sigmask(-2)?
|> The actual code in CVS is (lib/sighandle.c, in SIG_init()):
|> int i;
|> #ifdef POSIX
|> sigset_t sigset_test;
|> #endif
|> ...
|> #ifdef POSIX
|> (void) sigfillset(&sigset_test);
|> for (i = 1; sigismember(&sigset_test, i) == 1; i++)
|> ;
|> if (i < SIGMAX)
|> i = SIGMAX;
|> i++;
|> so cases below 1 don't matter. (The code is trying to figure out how
|> much space it needs to store an array of all signal handlers. I don't
|> think it is incorrect... it just breaks because sigismember(&xx, i)
|> for i > 32 is returning meaningless results.) According to Lewine's
|> POSIX book, sigismember returns 1 for yes, 0 for no, and -1 for error
|> (EINVAL); it is supposed to be "a portable way to support more than 32
|> signals".

I see your point.

|> >> You can change it to look for /usr/bin/diff.
|> I could, if I were to recompile it (I haven't downloaded
|> sources yet...) If I make a package out of this, I probably should
|> include a new diff3 in the package. However, since diff3 is included
|> as part of SLS, I'd rather just see it fixed in SLS...
|>
|> _Mark_ <eichin@athena.mit.edu>
|> MIT Student Information Processing Board
|> Cygnus Support <eichin@cygnus.com>

Maybe it is my fault. I will make new diff 2.0 to replace diff 1.15.

H.J.