Commit | Line | Data |
---|---|---|
9ab9afa9 | 1 | /* syssignal.h - System-dependent definitions for signals. |
99cf43f9 GM |
2 | |
3 | Copyright (C) 1993, 1999, 2001-2012 Free Software Foundation, Inc. | |
9ab9afa9 JB |
4 | |
5 | This file is part of GNU Emacs. | |
6 | ||
b9b1cc14 | 7 | GNU Emacs is free software: you can redistribute it and/or modify |
9ab9afa9 | 8 | it under the terms of the GNU General Public License as published by |
b9b1cc14 GM |
9 | the Free Software Foundation, either version 3 of the License, or |
10 | (at your option) any later version. | |
9ab9afa9 JB |
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 | |
b9b1cc14 | 18 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
9ab9afa9 | 19 | |
2fe28299 PE |
20 | #include <signal.h> |
21 | ||
383e0970 | 22 | extern void init_signals (void); |
2b98b088 | 23 | |
ae9e757a | 24 | #ifdef HAVE_PTHREAD |
333f1b6f | 25 | #include <pthread.h> |
f8240abd YM |
26 | /* If defined, asynchronous signals delivered to a non-main thread are |
27 | forwarded to the main thread. */ | |
28 | #define FORWARD_SIGNAL_TO_MAIN_THREAD | |
29 | #endif | |
30 | ||
1fa53021 | 31 | extern sigset_t empty_mask; |
9ab9afa9 | 32 | |
9af30bdf | 33 | typedef void (*signal_handler_t) (int); |
ae877222 | 34 | |
2fe28299 PE |
35 | extern void emacs_sigaction_init (struct sigaction *, signal_handler_t); |
36 | ||
68c45bf0 | 37 | #if NSIG < NSIG_MINIMUM |
2fe28299 | 38 | # undef NSIG |
68c45bf0 PE |
39 | # define NSIG NSIG_MINIMUM |
40 | #endif | |
41 | ||
9ab9afa9 JB |
42 | /* On bsd, [man says] kill does not accept a negative number to kill a pgrp. |
43 | Must do that using the killpg call. */ | |
6df54671 | 44 | #ifdef BSD_SYSTEM |
9ab9afa9 JB |
45 | #define EMACS_KILLPG(gid, signo) (killpg ( (gid), (signo))) |
46 | #else | |
57d65592 | 47 | #ifdef WINDOWSNT |
f405affb | 48 | #define EMACS_KILLPG(gid, signo) (kill (gid, signo)) |
57d65592 | 49 | #else |
9ab9afa9 JB |
50 | #define EMACS_KILLPG(gid, signo) (kill (-(gid), (signo))) |
51 | #endif | |
57d65592 | 52 | #endif |
9ab9afa9 JB |
53 | |
54 | /* Define SIGCHLD as an alias for SIGCLD. There are many conditionals | |
55 | testing SIGCHLD. */ | |
9ab9afa9 JB |
56 | #ifdef SIGCLD |
57 | #ifndef SIGCHLD | |
58 | #define SIGCHLD SIGCLD | |
985a35a3 JB |
59 | #endif /* SIGCHLD */ |
60 | #endif /* ! defined (SIGCLD) */ | |
68c45bf0 PE |
61 | |
62 | #ifndef HAVE_STRSIGNAL | |
63 | /* strsignal is in sysdep.c */ | |
361358ea | 64 | char *strsignal (int); |
68c45bf0 | 65 | #endif |
ab5796a9 | 66 | |
30730c93 | 67 | void handle_on_main_thread (int, signal_handler_t); |