o Add $FreeBSD$ as a rcsid instead of in a comment

o  Remove bitrotted #undef directives
o  Actually set errno now and order the functions

Submitted by: bde
This commit is contained in:
Marcel Moolenaar 1999-10-02 19:37:14 +00:00
parent 9102cd0abd
commit 075ff1d959
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51872

View File

@ -31,21 +31,46 @@
* SUCH DAMAGE.
*
* @(#)sigsetops.c 8.1 (Berkeley) 6/4/93
*
* $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
static char sccsid[] = "@(#)sigsetops.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
"$FreeBSD$";
#endif /* LIBC_SCCS and not lint */
#include <errno.h>
#include <signal.h>
#undef sigemptyset
#undef sigfillset
#undef sigaddset
#undef sigdelset
#undef sigismember
int
sigaddset(set, signo)
sigset_t *set;
int signo;
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
errno = EINVAL;
return (-1);
}
set->__bits[_SIG_WORD(signo)] |= _SIG_BIT(signo);
return (0);
}
int
sigdelset(set, signo)
sigset_t *set;
int signo;
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
errno = EINVAL;
return (-1);
}
set->__bits[_SIG_WORD(signo)] &= ~_SIG_BIT(signo);
return (0);
}
int
sigemptyset(set)
@ -65,35 +90,7 @@ sigfillset(set)
int i;
for (i = 0; i < _SIG_WORDS; i++)
set->__bits[i] = ~(unsigned int)0;
return (0);
}
int
sigaddset(set, signo)
sigset_t *set;
int signo;
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
/* errno = EINVAL; */
return (-1);
}
set->__bits[_SIG_WORD(signo)] |= _SIG_BIT(signo);
return (0);
}
int
sigdelset(set, signo)
sigset_t *set;
int signo;
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
/* errno = EINVAL; */
return (-1);
}
set->__bits[_SIG_WORD(signo)] &= ~_SIG_BIT(signo);
set->__bits[i] = ~0U;
return (0);
}
@ -104,7 +101,7 @@ sigismember(set, signo)
{
if (signo <= 0 || signo > _SIG_MAXSIG) {
/* errno = EINVAL; */
errno = EINVAL;
return (-1);
}
return ((set->__bits[_SIG_WORD(signo)] & _SIG_BIT(signo)) ? 1 : 0);