changeset 2913:409c1022bad5

Some changes from Michael K. Johnson for Linux. * sysdep.c (sys_siglist): Don't define this if HAVE_SYS_SIGLIST is #defined. That lets the system provide it, if it has it. * syssignal.h (sigmask): Only define this if <signal.h> hasn't given us a definition already. * syssignal.h (sys_sigpause): Fix argument in prototype. * sysdep.c (init_signals): The masks are called empty_mask and full_mask, not signal_empty_mask and signal_full_mask. (signal_handler_t): Moved .... * syssignal.h: ... to here. * systty.h (EMACS_SET_TTY_PGRP): Call tcsetpgrp with the correct arguments. * emacs.c (main): Don't try to establish signal handlers for SIGBUS and SIGSYS unless they're actually #defined.
author Jim Blandy <jimb@redhat.com>
date Wed, 19 May 1993 22:01:35 +0000
parents 32106dbf6d01
children eaddb57afc9f
files src/emacs.c src/sysdep.c src/syssignal.h
diffstat 3 files changed, 20 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/emacs.c	Wed May 19 22:01:21 1993 +0000
+++ b/src/emacs.c	Wed May 19 22:01:35 1993 +0000
@@ -407,9 +407,13 @@
       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);
--- a/src/sysdep.c	Wed May 19 22:01:21 1993 +0000
+++ b/src/sysdep.c	Wed May 19 22:01:35 1993 +0000
@@ -2040,14 +2040,10 @@
 
 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 @@
  *	always negligible.   Fred Fish, Unisoft Systems Inc.
  */
 
+#ifndef HAVE_SYS_SIGLIST
 char *sys_siglist[NSIG + 1] =
 {
 #ifdef AIX
@@ -2477,6 +2474,7 @@
 #endif /* not AIX */
   0
   };
+#endif HAVE_SYS_SIGLIST
 
 /*
  *	Warning, this function may not duplicate 4.2 action properly
--- a/src/syssignal.h	Wed May 19 22:01:21 1993 +0000
+++ b/src/syssignal.h	Wed May 19 22:01:35 1993 +0000
@@ -18,6 +18,9 @@
 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 @@
 
 /* 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 @@
 #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 @@
 #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);