Mail Archives: cygwin-developers/1998/05/06/07:46:58
A net user has just brought to my attention the fact that there is,
for some reason, macros in /usr/include/sys/signal.h which implement
sigaddset and sigdelset. This is clearly wrong as there are library
routines to handle this and the macro does no bounds checking.
I told the user to comment out the macros and use the library functions.
He then discovered that all of the mask operations in cygwin32 are
"off by one", i.e., the mask is set like this:
mask |= 1<<sig;
rather than
mask |= 1<<(sig - 1);
That means that we essentially allow signal 0 to be masked; which is pretty
worthless, IMHO. FWIW, the equivalent routines in newlib, which cygwin32
does not use, do the right thing.
I have a patch that fixes this behavior which is throughout cygwin32.
This will have ramifications with people who are using the newlib macro
but I think that it is important to make this operate more like UNIX.
I'd like to remove the macros in signal.h and remove the comments around
the function declarations. Is there any reason why I shouldn't do so?
Btw, this is all under a CYGWIN32 #ifdef so I shouldn't be affecting
any other code.
cgf
- Raw text -