OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [unix/] [sigset.c] - Blame information for rev 252

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
#ifndef _NO_SIGSET
2
 
3
#include <signal.h>
4
#include <errno.h>
5
 
6
#if defined(SIG_SETMASK) && NSIG <= 32  /* easier than trying to remove from Makefile */
7
 
8
#undef sigemptyset
9
int
10
sigemptyset (sigset_t * set)
11
{
12
  *set = (sigset_t) 0;
13
  return 0;
14
}
15
 
16
#undef sigfillset
17
int
18
sigfillset (sigset_t * set)
19
{
20
  *set = ~((sigset_t) 0);
21
  return 0;
22
}
23
 
24
#undef sigaddset
25
int
26
sigaddset (sigset_t * set, int signo)
27
{
28
  if (signo >= NSIG || signo <= 0)
29
    {
30
      errno = EINVAL;
31
      return -1;
32
    }
33
  *set |= 1 << (signo - 1);
34
  return 0;
35
}
36
 
37
#undef sigdelset
38
int
39
sigdelset (sigset_t * set, int signo)
40
{
41
  if (signo >= NSIG || signo <= 0)
42
    {
43
      errno = EINVAL;
44
      return -1;
45
    }
46
  *set &= ~(1 << (signo - 1));
47
  return 0;
48
}
49
 
50
#undef sigismember
51
int
52
sigismember (const sigset_t * set, int signo)
53
{
54
  if (signo >= NSIG || signo <= 0)
55
    {
56
      errno = EINVAL;
57
      return -1;
58
    }
59
 
60
  if (*set & (1 << (signo - 1)))
61
    return 1;
62
  else
63
    return 0;
64
}
65
 
66
#endif /* SIG_SETMASK */
67
#endif /* _NO_SIGSET  */

powered by: WebSVN 2.1.0

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