diff options
-rw-r--r-- | src/emacs.c | 4 | ||||
-rw-r--r-- | src/sysdep.c | 10 | ||||
-rw-r--r-- | src/syssignal.h | 15 |
3 files changed, 20 insertions, 9 deletions
diff --git a/src/emacs.c b/src/emacs.c index 68d0ce31696..dac22ca1c23 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -407,9 +407,13 @@ main (argc, argv, envp) signal (SIGEMT, fatal_error_signal); #endif signal (SIGFPE, fatal_error_signal); +#ifdef SIGBUS signal (SIGBUS, fatal_error_signal); +#endif signal (SIGSEGV, fatal_error_signal); +#ifdef SIGSYS signal (SIGSYS, fatal_error_signal); +#endif signal (SIGTERM, fatal_error_signal); #ifdef SIGXCPU signal (SIGXCPU, fatal_error_signal); diff --git a/src/sysdep.c b/src/sysdep.c index a6c1bdfbb34..99df6865338 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2040,14 +2040,10 @@ static struct sigaction new_action, old_action; init_signals () { -#ifdef POSIX_SIGNALS - sigemptyset (&signal_empty_mask); - sigfillset (&signal_full_mask); -#endif + sigemptyset (&empty_mask); + sigfillset (&full_mask); } -int (*signal_handler_t) (); - signal_handler_t sys_signal (int signal_number, signal_handler_t action) { @@ -2417,6 +2413,7 @@ sys_write (fildes, buf, nbyte) * always negligible. Fred Fish, Unisoft Systems Inc. */ +#ifndef HAVE_SYS_SIGLIST char *sys_siglist[NSIG + 1] = { #ifdef AIX @@ -2477,6 +2474,7 @@ char *sys_siglist[NSIG + 1] = #endif /* not AIX */ 0 }; +#endif HAVE_SYS_SIGLIST /* * Warning, this function may not duplicate 4.2 action properly diff --git a/src/syssignal.h b/src/syssignal.h index dddaee80924..ad3958647f2 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -18,6 +18,9 @@ along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef POSIX_SIGNALS + +#include <signal.h> + #define SIGMASKTYPE sigset_t #define SIGEMPTYMASK (empty_mask) @@ -26,6 +29,7 @@ extern sigset_t empty_mask, full_mask, temp_mask; /* POSIX pretty much destroys any possibility of writing sigmask as a macro in standard C. */ +#ifndef sigmask #ifdef __GNUC__ #define sigmask(SIG) \ ({ \ @@ -37,6 +41,7 @@ extern sigset_t empty_mask, full_mask, temp_mask; #else /* ! defined (__GNUC__) */ #define sigmask(SIG) (sys_sigmask (SIG)) #endif /* ! defined (__GNUC__) */ +#endif #define sigpause(SIG) sys_sigpause(SIG) #define sigblock(SIG) sys_sigblock(SIG) @@ -45,9 +50,13 @@ extern sigset_t empty_mask, full_mask, temp_mask; #define sighold(SIG) ONLY_USED_IN_BSD_4_1 #define sigrelse(SIG) ONLY_USED_IN_BSD_4_1 -int (*sys_signal (int signal_number, int (*action)())) (); -int sys_sigpause (int signal_number); -sigset_t sys_sigblock (sigset_t new_mask); +/* Whether this is what all systems want or not, this is what + appears to be assumed in the source, for example data.c:arith_error() */ +typedef RETSIGTYPE (*signal_handler_t) (int); + +signal_handler_t sys_signal (int signal_number, int (*action)()); +int sys_sigpause (sigset_t new_mask); +sigset_t sys_sigblock (sigset_t new_mask); sigset_t sys_sigunblock (sigset_t new_mask); sigset_t sys_sigsetmask (sigset_t new_mask); |