2008-11-19 05:47:44 +08:00
|
|
|
#ifndef _NO_SIGSET
|
|
|
|
|
2000-02-18 03:39:52 +08:00
|
|
|
#include <signal.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
2002-06-01 04:18:59 +08:00
|
|
|
#if defined(SIG_SETMASK) && NSIG <= 32 /* easier than trying to remove from Makefile */
|
2000-02-18 03:39:52 +08:00
|
|
|
|
|
|
|
#undef sigemptyset
|
|
|
|
int
|
|
|
|
sigemptyset (sigset_t * set)
|
|
|
|
{
|
|
|
|
*set = (sigset_t) 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-06-03 02:09:24 +08:00
|
|
|
#undef sigfillset
|
2000-02-18 03:39:52 +08:00
|
|
|
int
|
|
|
|
sigfillset (sigset_t * set)
|
|
|
|
{
|
|
|
|
*set = ~((sigset_t) 0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef sigaddset
|
|
|
|
int
|
|
|
|
sigaddset (sigset_t * set, int signo)
|
|
|
|
{
|
|
|
|
if (signo >= NSIG || signo <= 0)
|
|
|
|
{
|
|
|
|
errno = EINVAL;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
*set |= 1 << (signo - 1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-06-03 02:09:24 +08:00
|
|
|
#undef sigdelset
|
2000-02-18 03:39:52 +08:00
|
|
|
int
|
|
|
|
sigdelset (sigset_t * set, int signo)
|
|
|
|
{
|
|
|
|
if (signo >= NSIG || signo <= 0)
|
|
|
|
{
|
|
|
|
errno = EINVAL;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
*set &= ~(1 << (signo - 1));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-06-03 02:09:24 +08:00
|
|
|
#undef sigismember
|
2000-02-18 03:39:52 +08:00
|
|
|
int
|
|
|
|
sigismember (const sigset_t * set, int signo)
|
|
|
|
{
|
|
|
|
if (signo >= NSIG || signo <= 0)
|
|
|
|
{
|
|
|
|
errno = EINVAL;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*set & (1 << (signo - 1)))
|
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* SIG_SETMASK */
|
2008-11-19 05:47:44 +08:00
|
|
|
#endif /* _NO_SIGSET */
|