Subject: Re: POSIX signal macros broken/shakey on 1.0 beta
To: None <jconklin@netcom.com>
From: Dale Rahn <drahn@pacific.urbana.mcd.mot.com>
List: current-users
Date: 08/12/1994 10:10:28
> 
>    Again, isn't it better to be safe than sorry?  Whether Stevens'
>    interpretation of the POSIX.1 spec is right or wrong, many
>    programmers will be following his interpretation because of this
>    excellent book.
> 
> I think Stevens is wrong.
> 
> But because his book is widely read and used as a reference; and the
> fact that all of the assorted OS's I just checked detect invalid
> signal errors; and the fact that the masses may not see CVS 1.4 for
> some time has caused me to change my mind one more time.
> 
> I've decided that it's better to be pragmatic than pedantic in this
> matter.  Since I may have been the only opposition to changing the
> behavior to detect errors, I think this opens the window to the
> change.  
> 
> Since the function implementation already detects errors, all that is
> needed is for the sigaddset, sigdelset and sigismember macros to be
> removed from signal.h and for the manpage to be updated.
> 
> If anyone has any objections, raise them now.  Otherwise the change
> will go into the development tree tonight.  Someone from core can pull
> them into the 1.0 tree if they feel it's important enough.
> 
> 	--jtc
> 
> 
I agree with the removal of the functions.
When in doubt, RTFM.

From the IEEE Std 1003.1 First Edition 1990-12-07 (POSIX)
--
3.3.3.1 Synopsis
	.
	int sigaddset(sigset_t *set, int signo);
	int sigdelset(sigset_t *set, int signo);
	int sigismember(const sigset_t *set, int signo);
	.

3.3.3.4 Errors
	For each of the following conditions, if the condition is detected,
	the sigaddset(), sigdelset(), and sigismember() functions shall
	return -1 and set errno to be the corresponding value.

	[EINVAL] The value of the signo argument is invalid or unsupported
		 signal number.
--

It would seem that the current macro implementation is wrong.
The functions probably could be implemented as macros, but only
if they are done correctly, or just use the correct function version.

Dale Rahn

------------------------------------------------------------------------------