]> code.delx.au - gnu-emacs/blob - src/syssignal.h
Ibuffer change marks
[gnu-emacs] / src / syssignal.h
1 /* syssignal.h - System-dependent definitions for signals.
2
3 Copyright (C) 1993, 1999, 2001-2016 Free Software Foundation, Inc.
4
5 This file is part of GNU Emacs.
6
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.
11
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.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19
20 #ifndef EMACS_SYSSIGNAL_H
21 #define EMACS_SYSSIGNAL_H
22
23 #include <signal.h>
24
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_tty_out_signal (sigset_t *);
29 extern void unblock_tty_out_signal (sigset_t const *);
30
31 #ifdef HAVE_PTHREAD
32 #include <pthread.h>
33 /* If defined, asynchronous signals delivered to a non-main thread are
34 forwarded to the main thread. */
35 #define FORWARD_SIGNAL_TO_MAIN_THREAD
36 #endif
37
38 /* On Cygwin as of 2015-06-22 SIGEV_SIGNAL is defined as an enum
39 constant but not as a macro. */
40 #if defined CYGWIN && !defined SIGEV_SIGNAL
41 #define SIGEV_SIGNAL SIGEV_SIGNAL
42 #endif
43
44 #if defined HAVE_TIMER_SETTIME && defined SIGEV_SIGNAL
45 # define HAVE_ITIMERSPEC
46 #endif
47
48 #if (defined SIGPROF && !defined PROFILING \
49 && (defined HAVE_SETITIMER || defined HAVE_ITIMERSPEC))
50 # define PROFILER_CPU_SUPPORT
51 #endif
52
53 extern sigset_t empty_mask;
54
55 typedef void (*signal_handler_t) (int);
56
57 extern void emacs_sigaction_init (struct sigaction *, signal_handler_t);
58 char const *safe_strsignal (int) ATTRIBUTE_CONST;
59
60 #if NSIG < NSIG_MINIMUM
61 # undef NSIG
62 # define NSIG NSIG_MINIMUM
63 #endif
64
65 #ifndef SA_SIGINFO
66 # define SA_SIGINFO 0
67 #endif
68
69 #ifndef emacs_raise
70 # define emacs_raise(sig) raise (sig)
71 #endif
72
73 #ifndef HAVE_STRSIGNAL
74 # define strsignal(sig) safe_strsignal (sig)
75 #endif
76
77 void deliver_process_signal (int, signal_handler_t);
78
79 #endif /* EMACS_SYSSIGNAL_H */