This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
sigaddset() should return 0 or -1
- To: gnu-win32 at cygnus dot com
- Subject: sigaddset() should return 0 or -1
- From: rbh00 at netcom dot com (Richard Hitt)
- Date: Mon, 04 May 1998 07:33:41 GMT
- Reply-To: rbh00 at netcom dot com
Hi.
I'm porting an application that expects sigaddset() to return 0 if it
worked. But in the CDK, sigaddset is implemented by a macro that
doesn't care what it returns. The file is
/cygnus/b19/H-i386-cygwin32/i386-cygwin32/include/sys/signal.h.
The macro is
#define sigaddset(what,sig) (*(what) |= (1<<(sig)))
So I changed it to always return 0:
#define sigaddset(what,sig) ((*(what) |= (1<<(sig))),0)
and avoided an unpleasant hack in my application. May I suggest that
you consider incorporating this change in your signal.h? Or, for all
I know, there may be other considerations why the macro must be as it
is.
Thanks for a fine environment.
Richard Hitt
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".