Remove "[Add new features here]" for 2.27
[glibc.git] / sysdeps / generic / sigsetops.h
blobe8e55539816f9bd10bd0497dd533bb057cf7bcb2
1 /* __sigset_t manipulators. Generic/BSD version.
2 Copyright (C) 1991-2017 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _SIGSETOPS_H
20 #define _SIGSETOPS_H 1
22 #include <signal.h>
24 /* Return a mask that includes SIG only. The cast to `sigset_t' avoids
25 overflow if `sigset_t' is wider than `int'. */
26 # define __sigmask(sig) (((__sigset_t) 1) << ((sig) - 1))
28 #define __sigemptyset(set) \
29 (__extension__ ({ \
30 *(set) = (__sigset_t) 0; \
31 (void)0; \
32 }))
33 #define __sigfillset(set) \
34 (__extension__ ({ \
35 *(set) = ~(__sigset_t) 0; \
36 (void)0; \
37 }))
39 # define __sigisemptyset(set) \
40 (*(set) == (__sigset_t) 0)
42 # define __sigandset(dest, left, right) \
43 (__extension__ ({ \
44 *(dest) = *(left) & *(right); \
45 (void)0; \
46 }))
48 # define __sigorset(dest, left, right) \
49 (__extension__ ({ \
50 *(dest) = *(left) | *(right); \
51 (void)0; \
52 }))
53 #endif
55 /* These macros needn't check for a bogus signal number;
56 checking is done in the non-__ versions. */
57 # define __sigismember(set, sig) \
58 (__extension__ ({ \
59 __sigset_t __mask = __sigmask (sig); \
60 (set) & __mask ? 1 : 0; \
61 }))
63 # define __sigaddset(set, sig) \
64 (__extension__ ({ \
65 __sigset_t __mask = __sigmask (sig); \
66 (set) |= __mask; \
67 (void)0; \
68 }))
70 # define __sigdelset(set, sig) \
71 (__extension__ ({ \
72 __sigset_t __mask = __sigmask (sig); \
73 (set) &= ~__mask; \
74 (void)0; \
75 }))
77 #endif