From ef03a4e61efa0003b1b6be961b58297ccfddc664 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Mon, 3 May 2010 21:00:10 -0700 Subject: [PATCH] Remove POSIX_SIGNALS. * s/usg5-4.h (POSIX_SIGNALS): * s/netbsd.h (POSIX_SIGNALS): * s/msdos.h (POSIX_SIGNALS): * s/ms-w32.h (POSIX_SIGNALS): * s/hpux11.h (POSIX_SIGNALS): * s/gnu.h (POSIX_SIGNALS): * s/gnu-linux.h (POSIX_SIGNALS): * s/freebsd.h (POSIX_SIGNALS): * s/darwin.h (POSIX_SIGNALS): * s/cygwin.h (POSIX_SIGNALS): * s/aix4-2.h (POSIX_SIGNALS): Remove definition. * s/unixware.h: * s/sol2-6.h: Remove comments on POSIX_SIGNALS. * process.c (create_process): * syssignal.h: * sysdep.c (wait_for_termination, init_signals): * process.c (create_process): * msdos.c: POSIX_SIGNALS is always defined on all platforms, remove all code that assumes the contrary. --- src/ChangeLog | 23 +++++++++++++++++++++++ src/msdos.c | 8 -------- src/process.c | 26 -------------------------- src/s/aix4-2.h | 1 - src/s/cygwin.h | 1 - src/s/darwin.h | 4 ---- src/s/freebsd.h | 5 ----- src/s/gnu-linux.h | 1 - src/s/gnu.h | 2 -- src/s/hpux11.h | 5 ----- src/s/ms-w32.h | 2 -- src/s/msdos.h | 3 --- src/s/netbsd.h | 5 ----- src/s/sol2-6.h | 4 ++-- src/s/unixware.h | 4 ++-- src/s/usg5-4.h | 4 ---- src/sysdep.c | 24 ------------------------ src/syssignal.h | 11 ----------- 18 files changed, 27 insertions(+), 106 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4b24f85612..797ab69363 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,26 @@ +2010-05-04 Dan Nicolaescu + + Remove POSIX_SIGNALS. + * s/usg5-4.h (POSIX_SIGNALS): + * s/netbsd.h (POSIX_SIGNALS): + * s/msdos.h (POSIX_SIGNALS): + * s/ms-w32.h (POSIX_SIGNALS): + * s/hpux11.h (POSIX_SIGNALS): + * s/gnu.h (POSIX_SIGNALS): + * s/gnu-linux.h (POSIX_SIGNALS): + * s/freebsd.h (POSIX_SIGNALS): + * s/darwin.h (POSIX_SIGNALS): + * s/cygwin.h (POSIX_SIGNALS): + * s/aix4-2.h (POSIX_SIGNALS): Remove definition. + * s/unixware.h: + * s/sol2-6.h: Remove comments on POSIX_SIGNALS. + * process.c (create_process): + * syssignal.h: + * sysdep.c (wait_for_termination, init_signals): + * process.c (create_process): + * msdos.c: POSIX_SIGNALS is always defined on all platforms, + remove all code that assumes the contrary. + 2010-05-04 Glenn Morris * s/gnu-linux.h (LD_SWITCH_SYSTEM): Use LD_SWITCH_X_SITE_AUX as a shell diff --git a/src/msdos.c b/src/msdos.c index 6cde7cd6eb..28d621f8cc 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -4458,8 +4458,6 @@ setpriority (x,y,z) int x,y,z; { return 0; } #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 -#ifdef POSIX_SIGNALS - /* Augment DJGPP library POSIX signal functions. This is needed as of DJGPP v2.01, but might be in the library in later releases. */ @@ -4557,12 +4555,6 @@ sigprocmask (how, new_set, old_set) return 0; } -#else /* not POSIX_SIGNALS */ - -sigsetmask (x) int x; { return 0; } -sigblock (mask) int mask; { return 0; } - -#endif /* not POSIX_SIGNALS */ #endif /* not __DJGPP_MINOR__ < 2 */ #ifndef HAVE_SELECT diff --git a/src/process.c b/src/process.c index 29983b2285..a09ac297a2 100644 --- a/src/process.c +++ b/src/process.c @@ -1866,7 +1866,6 @@ create_process (process, new_argv, current_dir) #if !defined (WINDOWSNT) && defined (FD_CLOEXEC) int wait_child_setup[2]; #endif -#ifdef POSIX_SIGNALS sigset_t procmask; sigset_t blocked; struct sigaction sigint_action; @@ -1874,7 +1873,6 @@ create_process (process, new_argv, current_dir) #ifdef AIX struct sigaction sighup_action; #endif -#endif /* POSIX_SIGNALS */ /* Use volatile to protect variables from being clobbered by longjmp. */ volatile int forkin, forkout; volatile int pty_flag = 0; @@ -1979,7 +1977,6 @@ create_process (process, new_argv, current_dir) /* Delay interrupts until we have a chance to store the new fork's pid in its process structure */ -#ifdef POSIX_SIGNALS sigemptyset (&blocked); #ifdef SIGCHLD sigaddset (&blocked, SIGCHLD); @@ -1996,13 +1993,6 @@ create_process (process, new_argv, current_dir) #endif #endif /* HAVE_WORKING_VFORK */ sigprocmask (SIG_BLOCK, &blocked, &procmask); -#else /* !POSIX_SIGNALS */ -#ifdef SIGCHLD -#if defined (BSD_SYSTEM) - sigsetmask (sigmask (SIGCHLD)); -#endif /* BSD_SYSTEM */ -#endif /* SIGCHLD */ -#endif /* !POSIX_SIGNALS */ FD_SET (inchannel, &input_wait_mask); FD_SET (inchannel, &non_keyboard_wait_mask); @@ -2153,15 +2143,7 @@ create_process (process, new_argv, current_dir) signal (SIGQUIT, SIG_DFL); /* Stop blocking signals in the child. */ -#ifdef POSIX_SIGNALS sigprocmask (SIG_SETMASK, &procmask, 0); -#else /* !POSIX_SIGNALS */ -#ifdef SIGCHLD -#if defined (BSD_SYSTEM) - sigsetmask (SIGEMPTYMASK); -#endif /* BSD_SYSTEM */ -#endif /* SIGCHLD */ -#endif /* !POSIX_SIGNALS */ if (pty_flag) child_setup_tty (xforkout); @@ -2243,7 +2225,6 @@ create_process (process, new_argv, current_dir) /* Restore the signal state whether vfork succeeded or not. (We will signal an error, below, if it failed.) */ -#ifdef POSIX_SIGNALS #ifdef HAVE_WORKING_VFORK /* Restore the parent's signal handlers. */ sigaction (SIGINT, &sigint_action, 0); @@ -2254,13 +2235,6 @@ create_process (process, new_argv, current_dir) #endif /* HAVE_WORKING_VFORK */ /* Stop blocking signals in the parent. */ sigprocmask (SIG_SETMASK, &procmask, 0); -#else /* !POSIX_SIGNALS */ -#ifdef SIGCHLD -#if defined (BSD_SYSTEM) - sigsetmask (SIGEMPTYMASK); -#endif /* BSD_SYSTEM */ -#endif /* SIGCHLD */ -#endif /* !POSIX_SIGNALS */ /* Now generate the error if vfork failed. */ if (pid < 0) diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index b7de0312f7..0a36c8ff0d 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -126,7 +126,6 @@ along with GNU Emacs. If not, see . */ #define CLASH_DETECTION /* Perry Smith says these are correct. */ -#define POSIX_SIGNALS #undef sigmask #ifndef HAVE_LIBXMU diff --git a/src/s/cygwin.h b/src/s/cygwin.h index b2ade390c7..a337f15691 100644 --- a/src/s/cygwin.h +++ b/src/s/cygwin.h @@ -104,7 +104,6 @@ along with GNU Emacs. If not, see . */ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) #define SYSV_SYSTEM_DIR 1 #define UNEXEC unexcw.o -#define POSIX_SIGNALS 1 #define LINKER $(CC) /* Use terminfo instead of termcap. Fewer environment variables to diff --git a/src/s/darwin.h b/src/s/darwin.h index de8369ddae..6743b65cce 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -215,10 +215,6 @@ along with GNU Emacs. If not, see . */ ioctl TIOCSCTTY. */ #define DONT_REOPEN_PTY -/* This makes create_process in process.c save and restore signal - handlers correctly. Suggested by Nozomu Ando.*/ -#define POSIX_SIGNALS - /* Use the GC_MAKE_GCPROS_NOOPS (see lisp.h) method for marking the stack. */ #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS diff --git a/src/s/freebsd.h b/src/s/freebsd.h index 6c4da8f086..178eeffb1c 100644 --- a/src/s/freebsd.h +++ b/src/s/freebsd.h @@ -101,10 +101,5 @@ along with GNU Emacs. If not, see . */ #define USE_MMAP_FOR_BUFFERS 1 -/* Use sigprocmask(2) and friends instead of sigblock(2); the man page - of sigblock says it is obsolete. */ - -#define POSIX_SIGNALS 1 - /* arch-tag: 426529ca-b7c4-448f-b10a-d4dcdc9c78eb (do not change this comment) */ diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h index 73241f0c21..218af42bac 100644 --- a/src/s/gnu-linux.h +++ b/src/s/gnu-linux.h @@ -187,7 +187,6 @@ along with GNU Emacs. If not, see . */ #define SYSV_SYSTEM_DIR /* use dirent.h */ #define POSIX /* affects getpagesize.h and systty.h */ -#define POSIX_SIGNALS #undef LIB_GCC #define LIB_GCC diff --git a/src/s/gnu.h b/src/s/gnu.h index 13679a1db4..946eaa6512 100644 --- a/src/s/gnu.h +++ b/src/s/gnu.h @@ -28,8 +28,6 @@ along with GNU Emacs. If not, see . */ #define SIGNALS_VIA_CHARACTERS -#define POSIX_SIGNALS - /* Tell Emacs that we are a terminfo based system; disable the use of local termcap. (GNU uses ncurses.) */ #ifdef HAVE_LIBNCURSES diff --git a/src/s/hpux11.h b/src/s/hpux11.h index 3382395a90..48f6084104 100644 --- a/src/s/hpux11.h +++ b/src/s/hpux11.h @@ -1,10 +1,5 @@ #include "hpux10-20.h" -#ifdef POSIX_SIGNALS -#undef POSIX_SIGNALS -#endif -#define POSIX_SIGNALS 1 - /* SA_RESTART resets the timeout of `select', so don't use it. */ #define BROKEN_SA_RESTART diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 74e91c1e81..deb23322d9 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -123,8 +123,6 @@ along with GNU Emacs. If not, see . */ #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\') #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) -/* Do we have POSIX signals? (We don't, but we don't care, either.) */ -#define POSIX_SIGNALS 1 #include struct sigaction { int sa_flags; diff --git a/src/s/msdos.h b/src/s/msdos.h index bcef83ba03..8cd9bfc849 100644 --- a/src/s/msdos.h +++ b/src/s/msdos.h @@ -128,9 +128,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ /* Mode line description of a buffer's type. */ #define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B") -/* Do we have POSIX signals? */ -#define POSIX_SIGNALS - /* We have (the code to control) a mouse. */ #define HAVE_MOUSE diff --git a/src/s/netbsd.h b/src/s/netbsd.h index 2e48c3580d..147b2d1ad3 100644 --- a/src/s/netbsd.h +++ b/src/s/netbsd.h @@ -80,10 +80,5 @@ along with GNU Emacs. If not, see . */ #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS -/* Use sigprocmask and friends instead of sigblock; - sigblock is considered obsolete on NetBSD. */ - -#define POSIX_SIGNALS 1 - /* arch-tag: e80f364a-04e9-4faf-93cb-f36a0fe95c81 (do not change this comment) */ diff --git a/src/s/sol2-6.h b/src/s/sol2-6.h index 5ca5cfbc0d..c05387d47f 100644 --- a/src/s/sol2-6.h +++ b/src/s/sol2-6.h @@ -49,8 +49,8 @@ along with GNU Emacs. If not, see . */ #endif /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock - rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't - work if POSIX_SIGNALS is defined. It may also be appropriate for SVR4.x + rather than sighold/sigrelse, which appear to be BSD4.1 specific. + It may also be appropriate for SVR4.x (x<2) but I'm not sure. fnf@cygnus.com */ /* This sets the name of the slave side of the PTY. On SysVr4, grantpt(3) forks a subprocess, so keep sigchld_handler() from diff --git a/src/s/unixware.h b/src/s/unixware.h index d1e8748d91..6e42a0d4c5 100644 --- a/src/s/unixware.h +++ b/src/s/unixware.h @@ -32,8 +32,8 @@ along with GNU Emacs. If not, see . */ #define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock - rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't - work if POSIX_SIGNALS is defined. It may also be appropriate for SVR4.x + rather than sighold/sigrelse, which appear to be BSD4.1 specific. + It may also be appropriate for SVR4.x (x<2) but I'm not sure. fnf@cygnus.com */ /* This sets the name of the slave side of the PTY. On SysVr4, grantpt(3) forks a subprocess, so keep sigchld_handler() from diff --git a/src/s/usg5-4.h b/src/s/usg5-4.h index b02caf9a3d..8907781294 100644 --- a/src/s/usg5-4.h +++ b/src/s/usg5-4.h @@ -61,10 +61,6 @@ along with GNU Emacs. If not, see . */ #define LDAV_SYMBOL "avenrun" -/* Special hacks needed to make Emacs run on this system. */ - -#define POSIX_SIGNALS - /* setjmp and longjmp can safely replace _setjmp and _longjmp, but they will run slower. */ diff --git a/src/sysdep.c b/src/sysdep.c index 7a9872e13c..38492c1bb0 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -419,7 +419,6 @@ wait_for_termination (pid) else sigpause (SIGEMPTYMASK); #else /* not BSD_SYSTEM, and not HPUX version >= 6 */ -#ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */ #ifdef WINDOWSNT wait (0); break; @@ -434,24 +433,6 @@ wait_for_termination (pid) sigsuspend (&empty_mask); #endif /* not WINDOWSNT */ -#else /* not POSIX_SIGNALS */ -#ifdef HAVE_SYSV_SIGPAUSE - sighold (SIGCHLD); - if (0 > kill (pid, 0)) - { - sigrelse (SIGCHLD); - break; - } - sigpause (SIGCHLD); -#else /* not HAVE_SYSV_SIGPAUSE */ - if (0 > kill (pid, 0)) - break; - /* Using sleep instead of pause avoids timing error. - If the inferior dies just before the sleep, - we lose just one second. */ - sleep (1); -#endif /* not HAVE_SYSV_SIGPAUSE */ -#endif /* not POSIX_SIGNALS */ #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ #else /* not subprocesses */ break; @@ -2090,8 +2071,6 @@ read_input_waiting () /* POSIX signals support - DJB */ /* Anyone with POSIX signals should have ANSI C declarations */ -#ifdef POSIX_SIGNALS - sigset_t empty_mask, full_mask; #ifndef WINDOWSNT @@ -2168,7 +2147,6 @@ sys_sigsetmask (sigset_t new_mask) return (old_mask); } -#endif /* POSIX_SIGNALS */ #if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST static char *my_sys_siglist[NSIG]; @@ -2181,10 +2159,8 @@ static char *my_sys_siglist[NSIG]; void init_signals () { -#ifdef POSIX_SIGNALS sigemptyset (&empty_mask); sigfillset (&full_mask); -#endif #if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST if (! initialized) diff --git a/src/syssignal.h b/src/syssignal.h index f435d33859..9a145b78cb 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -30,8 +30,6 @@ extern void init_signals P_ ((void)); extern pthread_t main_thread; #endif -#ifdef POSIX_SIGNALS - /* Don't #include . That header should always be #included before "config.h", because some configuration files (like s/hpux.h) indicate that SIGIO doesn't work by #undef-ing SIGIO. If this file @@ -87,15 +85,6 @@ sigset_t sys_sigsetmask P_ ((sigset_t new_mask)); #define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG) -#else /* ! defined (POSIX_SIGNALS) */ - -#ifndef sigunblock -#define sigunblock(SIG) \ -{ SIGMASKTYPE omask = sigblock (SIGEMPTYMASK); sigsetmask (omask & ~SIG); } -#endif - -#endif /* ! defined (POSIX_SIGNALS) */ - #ifndef SIGMASKTYPE #define SIGMASKTYPE int #endif -- 2.20.1