OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [unix/] [sigset.c] - Diff between revs 1010 and 1765

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 */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.