URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 1010 |
Rev 1765 |
#include <signal.h>
|
#include <signal.h>
|
#include <errno.h>
|
#include <errno.h>
|
|
|
#ifdef SIG_SETMASK /* easier than trying to remove from Makefile */
|
#ifdef SIG_SETMASK /* easier than trying to remove from Makefile */
|
|
|
#undef sigemptyset
|
#undef sigemptyset
|
int
|
int
|
sigemptyset (sigset_t * set)
|
sigemptyset (sigset_t * set)
|
{
|
{
|
*set = (sigset_t) 0;
|
*set = (sigset_t) 0;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int
|
int
|
sigfillset (sigset_t * set)
|
sigfillset (sigset_t * set)
|
{
|
{
|
*set = ~((sigset_t) 0);
|
*set = ~((sigset_t) 0);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
#undef sigaddset
|
#undef sigaddset
|
int
|
int
|
sigaddset (sigset_t * set, int signo)
|
sigaddset (sigset_t * set, int signo)
|
{
|
{
|
if (signo >= NSIG || signo <= 0)
|
if (signo >= NSIG || signo <= 0)
|
{
|
{
|
errno = EINVAL;
|
errno = EINVAL;
|
return -1;
|
return -1;
|
}
|
}
|
*set |= 1 << (signo - 1);
|
*set |= 1 << (signo - 1);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int
|
int
|
sigdelset (sigset_t * set, int signo)
|
sigdelset (sigset_t * set, int signo)
|
{
|
{
|
if (signo >= NSIG || signo <= 0)
|
if (signo >= NSIG || signo <= 0)
|
{
|
{
|
errno = EINVAL;
|
errno = EINVAL;
|
return -1;
|
return -1;
|
}
|
}
|
*set &= ~(1 << (signo - 1));
|
*set &= ~(1 << (signo - 1));
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int
|
int
|
sigismember (const sigset_t * set, int signo)
|
sigismember (const sigset_t * set, int signo)
|
{
|
{
|
if (signo >= NSIG || signo <= 0)
|
if (signo >= NSIG || signo <= 0)
|
{
|
{
|
errno = EINVAL;
|
errno = EINVAL;
|
return -1;
|
return -1;
|
}
|
}
|
|
|
if (*set & (1 << (signo - 1)))
|
if (*set & (1 << (signo - 1)))
|
return 1;
|
return 1;
|
else
|
else
|
return 0;
|
return 0;
|
}
|
}
|
|
|
#endif /* SIG_SETMASK */
|
#endif /* SIG_SETMASK */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.