* syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
[bpt/emacs.git] / src / syssignal.h
CommitLineData
9ab9afa9 1/* syssignal.h - System-dependent definitions for signals.
99cf43f9
GM
2
3Copyright (C) 1993, 1999, 2001-2012 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 20#include <signal.h>
4d7e6e51 21#include <stdbool.h>
2fe28299 22
4d7e6e51 23extern void init_signals (bool);
2b98b088 24
ae9e757a 25#ifdef HAVE_PTHREAD
333f1b6f 26#include <pthread.h>
f8240abd
YM
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
cb5b0266
PE
32#if (defined SIGPROF && (defined HAVE_TIMER_SETTIME || defined HAVE_SETITIMER) \
33 && !defined PROFILING)
d89460ed
PE
34# define PROFILER_CPU_SUPPORT
35#endif
36
1fa53021 37extern sigset_t empty_mask;
9ab9afa9 38
9af30bdf 39typedef void (*signal_handler_t) (int);
ae877222 40
2fe28299
PE
41extern void emacs_sigaction_init (struct sigaction *, signal_handler_t);
42
68c45bf0 43#if NSIG < NSIG_MINIMUM
2fe28299 44# undef NSIG
68c45bf0
PE
45# define NSIG NSIG_MINIMUM
46#endif
47
4d7e6e51
PE
48#ifndef emacs_raise
49# define emacs_raise(sig) raise (sig)
50#endif
51
9ab9afa9
JB
52/* On bsd, [man says] kill does not accept a negative number to kill a pgrp.
53 Must do that using the killpg call. */
6df54671 54#ifdef BSD_SYSTEM
9ab9afa9
JB
55#define EMACS_KILLPG(gid, signo) (killpg ( (gid), (signo)))
56#else
57d65592 57#ifdef WINDOWSNT
f405affb 58#define EMACS_KILLPG(gid, signo) (kill (gid, signo))
57d65592 59#else
9ab9afa9
JB
60#define EMACS_KILLPG(gid, signo) (kill (-(gid), (signo)))
61#endif
57d65592 62#endif
9ab9afa9
JB
63
64/* Define SIGCHLD as an alias for SIGCLD. There are many conditionals
65 testing SIGCHLD. */
9ab9afa9
JB
66#ifdef SIGCLD
67#ifndef SIGCHLD
68#define SIGCHLD SIGCLD
985a35a3
JB
69#endif /* SIGCHLD */
70#endif /* ! defined (SIGCLD) */
68c45bf0
PE
71
72#ifndef HAVE_STRSIGNAL
73/* strsignal is in sysdep.c */
361358ea 74char *strsignal (int);
68c45bf0 75#endif
ab5796a9 76
4d7e6e51 77void deliver_process_signal (int, signal_handler_t);