Fix building Loongarch BFD with a 32-bit compiler
[binutils-gdb.git] / gdbsupport / signals-state-save-restore.h
blob132aaa8c5228f503a7c4073a6b6ae9cad75008d7
1 /* Copyright (C) 2016-2024 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #ifndef COMMON_SIGNALS_STATE_SAVE_RESTORE_H
19 #define COMMON_SIGNALS_STATE_SAVE_RESTORE_H
21 /* Save/restore the signal actions of all signals, and the signal
22 mask.
24 Since the exec family of functions does not reset the signal
25 disposition of signals set to SIG_IGN, nor does it reset the signal
26 mask, in order to be transparent, when spawning new child processes
27 to debug (with "run", etc.), we must reset signal actions and mask
28 back to what was originally inherited from gdb/gdbserver's parent,
29 just before execing the target program to debug. */
31 /* Save the signal state of all signals. If !QUIET, warn if we detect
32 a custom signal handler preinstalled. */
34 extern void save_original_signals_state (bool quiet);
36 /* Restore the signal state of all signals. */
38 extern void restore_original_signals_state (void);
40 #endif /* COMMON_SIGNALS_STATE_SAVE_RESTORE_H */