]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/generic/internal-signals.h
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / generic / internal-signals.h
CommitLineData
92aabad9 1/* Special use of signals internally. Stub version.
04277e02 2 Copyright (C) 2014-2019 Free Software Foundation, Inc.
23fe486b
RM
3 This file is part of the GNU C Library.
4
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.
9
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.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
5a82c748 17 <https://www.gnu.org/licenses/>. */
d2dc5467
AZ
18
19#ifndef __INTERNAL_SIGNALS_H
20# define __INTERNAL_SIGNALS_H
21
9185f86d
ZW
22#include <signal.h>
23#include <sigsetops.h>
24#include <stdbool.h>
25
d2dc5467
AZ
26static inline bool
27__is_internal_signal (int sig)
28{
29 return false;
30}
31
32static inline void
33__clear_internal_signals (sigset_t *set)
34{
35}
36
37static inline int
38__libc_signal_block_all (sigset_t *set)
39{
9185f86d
ZW
40 sigset_t allset;
41 __sigfillset (&allset);
42 return __sigprocmask (SIG_BLOCK, &allset, set);
d2dc5467
AZ
43}
44
45static inline int
46__libc_signal_block_app (sigset_t *set)
47{
9185f86d
ZW
48 sigset_t allset;
49 __sigfillset (&allset);
50 __clear_internal_signals (&allset);
51 return __sigprocmask (SIG_BLOCK, &allset, set);
d2dc5467
AZ
52}
53
54/* Restore current process signal mask. */
55static inline int
56__libc_signal_restore_set (const sigset_t *set)
57{
9185f86d 58 return __sigprocmask (SIG_SETMASK, set, NULL);
d2dc5467
AZ
59}
60
61
62#endif /* __INTERNAL_SIGNALS_H */