* syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
[bpt/emacs.git] / src / syssignal.h
1 /* syssignal.h - System-dependent definitions for signals.
2
3 Copyright (C) 1993, 1999, 2001-2012 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
10 (at 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 #include <signal.h>
21 #include <stdbool.h>
22
23 extern void init_signals (bool);
24
25 #ifdef HAVE_PTHREAD
26 #include <pthread.h>
27 /* If defined, asynchronous signals delivered to a non-main thread are
28 forwarded to the main thread. */
29 #define FORWARD_SIGNAL_TO_MAIN_THREAD
30 #endif
31
32 #if (defined SIGPROF && (defined HAVE_TIMER_SETTIME || defined HAVE_SETITIMER) \
33 && !defined PROFILING)
34 # define PROFILER_CPU_SUPPORT
35 #endif
36
37 extern sigset_t empty_mask;
38
39 typedef void (*signal_handler_t) (int);
40
41 extern void emacs_sigaction_init (struct sigaction *, signal_handler_t);
42
43 #if NSIG < NSIG_MINIMUM
44 # undef NSIG
45 # define NSIG NSIG_MINIMUM
46 #endif
47
48 #ifndef emacs_raise
49 # define emacs_raise(sig) raise (sig)
50 #endif
51
52 /* On bsd, [man says] kill does not accept a negative number to kill a pgrp.
53 Must do that using the killpg call. */
54 #ifdef BSD_SYSTEM
55 #define EMACS_KILLPG(gid, signo) (killpg ( (gid), (signo)))
56 #else
57 #ifdef WINDOWSNT
58 #define EMACS_KILLPG(gid, signo) (kill (gid, signo))
59 #else
60 #define EMACS_KILLPG(gid, signo) (kill (-(gid), (signo)))
61 #endif
62 #endif
63
64 /* Define SIGCHLD as an alias for SIGCLD. There are many conditionals
65 testing SIGCHLD. */
66 #ifdef SIGCLD
67 #ifndef SIGCHLD
68 #define SIGCHLD SIGCLD
69 #endif /* SIGCHLD */
70 #endif /* ! defined (SIGCLD) */
71
72 #ifndef HAVE_STRSIGNAL
73 /* strsignal is in sysdep.c */
74 char *strsignal (int);
75 #endif
76
77 void deliver_process_signal (int, signal_handler_t);