gdb/testsuite: fix gdb.trace/signal.exp on x86
[binutils-gdb/blckswan.git] / gdbsupport / gdb-sigmask.h
blob0c1f9ea8ee764d6815f1b0e3744734d83bc50b32
1 /* sigprocmask wrapper for gdb
3 Copyright (C) 2019-2022 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 #ifndef GDBSUPPORT_GDB_SIGMASK_H
21 #define GDBSUPPORT_GDB_SIGMASK_H
23 #include <signal.h>
25 #ifdef HAVE_SIGPROCMASK
27 #ifdef HAVE_PTHREAD_SIGMASK
28 #define gdb_sigmask pthread_sigmask
29 #else
30 #define gdb_sigmask sigprocmask
31 #endif
33 #else /* HAVE_SIGPROCMASK */
35 /* Other code checks HAVE_SIGPROCMASK, but if there happened to be a
36 system that only had pthread_sigmask, we could still use it with
37 some extra changes. */
38 #ifdef HAVE_PTHREAD_SIGMASK
39 #error pthread_sigmask available without sigprocmask - please report
40 #endif
42 #endif /* HAVE_SIGPROCMASK */
45 #endif /* GDBSUPPORT_GDB_SIGMASK_H */