; doc/emacs/misc.texi (Network Security): Fix typo.
[emacs.git] / src / syssignal.h
blob0887eacb05d7f59c810ab4811dea65e46828570e
1 /* syssignal.h - System-dependent definitions for signals.
3 Copyright (C) 1993, 1999, 2001-2018 Free Software Foundation, Inc.
5 This file is part of GNU Emacs.
7 GNU Emacs 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 (at
10 your option) any later version.
12 GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
20 #ifndef EMACS_SYSSIGNAL_H
21 #define EMACS_SYSSIGNAL_H
23 #include <signal.h>
25 extern void init_signals (bool);
26 extern void block_child_signal (sigset_t *);
27 extern void unblock_child_signal (sigset_t const *);
28 extern void block_interrupt_signal (sigset_t *);
29 extern void restore_signal_mask (sigset_t const *);
30 extern void block_tty_out_signal (sigset_t *);
31 extern void unblock_tty_out_signal (sigset_t const *);
33 #ifdef HAVE_PTHREAD
34 #include <pthread.h>
35 /* If defined, asynchronous signals delivered to a non-main thread are
36 forwarded to the main thread. */
37 #define FORWARD_SIGNAL_TO_MAIN_THREAD
38 #endif
40 /* On Cygwin as of 2015-06-22 SIGEV_SIGNAL is defined as an enum
41 constant but not as a macro. */
42 #if defined CYGWIN && !defined SIGEV_SIGNAL
43 #define SIGEV_SIGNAL SIGEV_SIGNAL
44 #endif
46 #if defined HAVE_TIMER_SETTIME && defined SIGEV_SIGNAL
47 # define HAVE_ITIMERSPEC
48 #endif
50 #if (defined SIGPROF && !defined PROFILING \
51 && (defined HAVE_SETITIMER || defined HAVE_ITIMERSPEC))
52 # define PROFILER_CPU_SUPPORT
53 #endif
55 extern sigset_t empty_mask;
57 typedef void (*signal_handler_t) (int);
59 extern void emacs_sigaction_init (struct sigaction *, signal_handler_t);
60 char const *safe_strsignal (int) ATTRIBUTE_CONST;
62 #if NSIG < NSIG_MINIMUM
63 # undef NSIG
64 # define NSIG NSIG_MINIMUM
65 #endif
67 #ifndef SA_SIGINFO
68 # define SA_SIGINFO 0
69 #endif
71 #ifndef emacs_raise
72 # define emacs_raise(sig) raise (sig)
73 #endif
75 #ifndef HAVE_STRSIGNAL
76 # define strsignal(sig) safe_strsignal (sig)
77 #endif
79 void deliver_process_signal (int, signal_handler_t);
81 #endif /* EMACS_SYSSIGNAL_H */