Merge from emacs-24; up to 2014-04-25T10:35:01Z!michael.albinus@gmx.de
[bpt/emacs.git] / src / syssignal.h
CommitLineData
9ab9afa9 1/* syssignal.h - System-dependent definitions for signals.
99cf43f9 2
ba318903 3Copyright (C) 1993, 1999, 2001-2014 Free Software Foundation, Inc.
9ab9afa9
JB
4
5This file is part of GNU Emacs.
6
b9b1cc14 7GNU Emacs is free software: you can redistribute it and/or modify
9ab9afa9 8it under the terms of the GNU General Public License as published by
b9b1cc14
GM
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
9ab9afa9
JB
11
12GNU Emacs is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
b9b1cc14 18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
9ab9afa9 19
2fe28299
PE
20#include <signal.h>
21
4d7e6e51 22extern void init_signals (bool);
4e74624d
PE
23extern void block_tty_out_signal (sigset_t *);
24extern void unblock_tty_out_signal (sigset_t const *);
2b98b088 25
ae9e757a 26#ifdef HAVE_PTHREAD
333f1b6f 27#include <pthread.h>
f8240abd
YM
28/* If defined, asynchronous signals delivered to a non-main thread are
29 forwarded to the main thread. */
30#define FORWARD_SIGNAL_TO_MAIN_THREAD
31#endif
32
2b794d69
PE
33#if defined HAVE_TIMER_SETTIME && defined SIGEV_SIGNAL
34# define HAVE_ITIMERSPEC
35#endif
36
37#if (defined SIGPROF && !defined PROFILING \
38 && (defined HAVE_SETITIMER || defined HAVE_ITIMERSPEC))
d89460ed
PE
39# define PROFILER_CPU_SUPPORT
40#endif
41
1fa53021 42extern sigset_t empty_mask;
9ab9afa9 43
9af30bdf 44typedef void (*signal_handler_t) (int);
ae877222 45
2fe28299 46extern void emacs_sigaction_init (struct sigaction *, signal_handler_t);
c622b48f 47char const *safe_strsignal (int) ATTRIBUTE_CONST;
2fe28299 48
68c45bf0 49#if NSIG < NSIG_MINIMUM
2fe28299 50# undef NSIG
68c45bf0
PE
51# define NSIG NSIG_MINIMUM
52#endif
53
f019a684
PE
54#ifndef SA_SIGINFO
55# define SA_SIGINFO 0
56#endif
57
4d7e6e51
PE
58#ifndef emacs_raise
59# define emacs_raise(sig) raise (sig)
60#endif
61
68c45bf0 62#ifndef HAVE_STRSIGNAL
aa1ba90e 63# define strsignal(sig) safe_strsignal (sig)
68c45bf0 64#endif
ab5796a9 65
4d7e6e51 66void deliver_process_signal (int, signal_handler_t);