aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert1999-11-22 08:19:51 +0000
committerPaul Eggert1999-11-22 08:19:51 +0000
commitca9c056758a507f1508933de24d2410188b978fb (patch)
tree6da0a2b930d59b0c44dbd8f6d29faf8564589319 /src
parentb718982a2a661a3bf4bb226ff164925c3d0f9ed3 (diff)
downloademacs-ca9c056758a507f1508933de24d2410188b978fb.tar.gz
emacs-ca9c056758a507f1508933de24d2410188b978fb.zip
* callproc.c (strerror): Remove decl.
* fileio.c (strerror): Likewise. * process.c (strerror): Likewise. * emacs.c (strerror): Likewise. (Vsystem_messages_locale): Renamed from Vmessages_locale. All uses changed. (Vprevious_system_messages_locale): Likewise, from Vprevious_messages_locale. (Vsystem_time_locale): Likewise, from Vtime_locale. (Vprevious_system_time_locale): Likewise, from Vprevious_time_locale. (ABORT_RETURN_TYPE): New macro. (abort): Return type is now ABORT_RETURN_TYPE. (main): Always invoke init_signals, even if POSIX_SIGNALS is not defined. (syms_of_emacs): messages-locale -> system-messages-locale, previous-messages-locale -> previous-system-messages-locale, time-locale -> system-time-locale, previous-time-locale -> previous-system-time-locale. * gmalloc.c (PP, __ptr_t): Assume ANSI C if STDC_HEADERS is defined. (const): Do not define; that's config.h's job. (<limits.h>): Include if HAVE_LIMITS_H is defined. (CHAR_BIT): Move test for definedness outside of limits.h condition. (<stddef.h>): Include if STDC_HEADERS is defined. (FREE_RETURN_TYPE): New macro. (free): Return type is now FREE_RETURN_TYPE. * lisp.h (synchronize_system_time_locale): Renamed from synchronize_time_locale. All uses changed. (synchronize_system_messages_locale): Likewise, from synchronize_messages_locale. * process.c (sys_siglist): Remove. * syntax.c (scan_sexps_forward): Use abort, not assert. * sysdep.c (my_sys_siglist): New var. (sys_siglist): New macro. Remove old initialized vars of same name. (init_signals): Initialize sys_siglist. * xfns.c (abort): Remove decl; stdlib.h now does this.
Diffstat (limited to 'src')
-rw-r--r--src/callproc.c5
-rw-r--r--src/coding.c2
-rw-r--r--src/editfns.c2
-rw-r--r--src/emacs.c59
-rw-r--r--src/fileio.c4
-rw-r--r--src/gmalloc.c22
-rw-r--r--src/lisp.h8
-rw-r--r--src/process.c49
-rw-r--r--src/syntax.c4
-rw-r--r--src/sysdep.c378
-rw-r--r--src/w32proc.c2
-rw-r--r--src/xfns.c3
12 files changed, 236 insertions, 302 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 5ea59bf4629..e1d40b35055 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
25#include <stdio.h> 25#include <stdio.h>
26 26
27extern int errno; 27extern int errno;
28extern char *strerror ();
29 28
30/* Define SIGCHLD as an alias for SIGCLD. */ 29/* Define SIGCHLD as an alias for SIGCLD. */
31 30
@@ -560,7 +559,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
560 synch_process_retcode = pid; 559 synch_process_retcode = pid;
561 if (synch_process_retcode < 0) /* means it couldn't be exec'ed */ 560 if (synch_process_retcode < 0) /* means it couldn't be exec'ed */
562 { 561 {
563 synchronize_messages_locale (); 562 synchronize_system_messages_locale ();
564 synch_process_death = strerror (errno); 563 synch_process_death = strerror (errno);
565 } 564 }
566 565
@@ -588,7 +587,7 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
588 synch_process_retcode = pid; 587 synch_process_retcode = pid;
589 if (synch_process_retcode < 0) /* means it couldn't be exec'ed */ 588 if (synch_process_retcode < 0) /* means it couldn't be exec'ed */
590 { 589 {
591 synchronize_messages_locale (); 590 synchronize_system_messages_locale ();
592 synch_process_death = strerror (errno); 591 synch_process_death = strerror (errno);
593 } 592 }
594 593
diff --git a/src/coding.c b/src/coding.c
index c5dfd2102d0..8d840fc85fd 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5868,7 +5868,7 @@ emacs_strerror (error_number)
5868{ 5868{
5869 char *str; 5869 char *str;
5870 5870
5871 synchronize_messages_locale (); 5871 synchronize_system_messages_locale ();
5872 str = strerror (error_number); 5872 str = strerror (error_number);
5873 5873
5874 if (! NILP (Vlocale_coding_system)) 5874 if (! NILP (Vlocale_coding_system))
diff --git a/src/editfns.c b/src/editfns.c
index f6f30ee99a2..9cbebbda836 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1295,7 +1295,7 @@ DEFUN ("format-time-string", Fformat_time_string, Sformat_time_string, 1, 3, 0,
1295 if (! tm) 1295 if (! tm)
1296 error ("Specified time is not representable"); 1296 error ("Specified time is not representable");
1297 1297
1298 synchronize_time_locale (); 1298 synchronize_system_time_locale ();
1299 1299
1300 while (1) 1300 while (1)
1301 { 1301 {
diff --git a/src/emacs.c b/src/emacs.c
index 932c3758a91..192b308bbc0 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -67,7 +67,6 @@ Boston, MA 02111-1307, USA. */
67extern void malloc_warning (); 67extern void malloc_warning ();
68extern void set_time_zone_rule (); 68extern void set_time_zone_rule ();
69extern char *index (); 69extern char *index ();
70extern char *strerror ();
71 70
72/* Command line args from shell, as list of strings */ 71/* Command line args from shell, as list of strings */
73Lisp_Object Vcommand_line_args; 72Lisp_Object Vcommand_line_args;
@@ -128,10 +127,10 @@ Lisp_Object Vsystem_configuration_options;
128Lisp_Object Qfile_name_handler_alist; 127Lisp_Object Qfile_name_handler_alist;
129 128
130/* Current and previous system locales for messages and time. */ 129/* Current and previous system locales for messages and time. */
131Lisp_Object Vmessages_locale; 130Lisp_Object Vsystem_messages_locale;
132Lisp_Object Vprevious_messages_locale; 131Lisp_Object Vprevious_system_messages_locale;
133Lisp_Object Vtime_locale; 132Lisp_Object Vsystem_time_locale;
134Lisp_Object Vprevious_time_locale; 133Lisp_Object Vprevious_system_time_locale;
135 134
136/* If non-zero, emacs should not attempt to use an window-specific code, 135/* If non-zero, emacs should not attempt to use an window-specific code,
137 but instead should use the virtual terminal under which it was started */ 136 but instead should use the virtual terminal under which it was started */
@@ -283,7 +282,12 @@ memory_warning_signal (sig)
283 MSDOS has its own definition on msdos.c */ 282 MSDOS has its own definition on msdos.c */
284 283
285#if ! defined (DOS_NT) && ! defined (NO_ABORT) 284#if ! defined (DOS_NT) && ! defined (NO_ABORT)
286void 285
286#ifndef ABORT_RETURN_TYPE
287#define ABORT_RETURN_TYPE void
288#endif
289
290ABORT_RETURN_TYPE
287abort () 291abort ()
288{ 292{
289 kill (getpid (), SIGABRT); 293 kill (getpid (), SIGABRT);
@@ -881,9 +885,7 @@ the Bugs section of the Emacs manual or the file BUGS.\n", argv[0]);
881#endif 885#endif
882 } 886 }
883 887
884#ifdef POSIX_SIGNALS
885 init_signals (); 888 init_signals ();
886#endif
887 889
888 /* Don't catch SIGHUP if dumping. */ 890 /* Don't catch SIGHUP if dumping. */
889 if (1 891 if (1
@@ -1019,8 +1021,8 @@ the Bugs section of the Emacs manual or the file BUGS.\n", argv[0]);
1019 if (do_initial_setlocale) 1021 if (do_initial_setlocale)
1020 { 1022 {
1021 fixup_locale (); 1023 fixup_locale ();
1022 Vmessages_locale = Vprevious_messages_locale; 1024 Vsystem_messages_locale = Vprevious_system_messages_locale;
1023 Vtime_locale = Vprevious_time_locale; 1025 Vsystem_time_locale = Vprevious_system_time_locale;
1024 } 1026 }
1025 1027
1026 init_eval (); 1028 init_eval ();
@@ -1905,10 +1907,10 @@ fixup_locale ()
1905 1907
1906#ifdef LC_MESSAGES 1908#ifdef LC_MESSAGES
1907 l = setlocale (LC_MESSAGES, (char *) 0); 1909 l = setlocale (LC_MESSAGES, (char *) 0);
1908 Vprevious_messages_locale = l ? build_string (l) : Qnil; 1910 Vprevious_system_messages_locale = l ? build_string (l) : Qnil;
1909#endif 1911#endif
1910 l = setlocale (LC_TIME, (char *) 0); 1912 l = setlocale (LC_TIME, (char *) 0);
1911 Vprevious_time_locale = l ? build_string (l) : Qnil; 1913 Vprevious_system_time_locale = l ? build_string (l) : Qnil;
1912} 1914}
1913 1915
1914static void 1916static void
@@ -1923,20 +1925,22 @@ synchronize_locale (category, plocale, desired_locale)
1923 *plocale = desired_locale; 1925 *plocale = desired_locale;
1924} 1926}
1925 1927
1926/* Set system time locale to match Vtime_locale, if possible. */ 1928/* Set system time locale to match Vsystem_time_locale, if possible. */
1927void 1929void
1928synchronize_time_locale () 1930synchronize_system_time_locale ()
1929{ 1931{
1930 synchronize_locale (LC_TIME, &Vprevious_time_locale, Vtime_locale); 1932 synchronize_locale (LC_TIME, &Vprevious_system_time_locale,
1933 Vsystem_time_locale);
1931} 1934}
1932 1935
1933/* Set system messages locale to match Vmessages_locale, if possible. */ 1936/* Set system messages locale to match Vsystem_messages_locale, if
1937 possible. */
1934void 1938void
1935synchronize_messages_locale () 1939synchronize_system_messages_locale ()
1936{ 1940{
1937#ifdef LC_MESSAGES 1941#ifdef LC_MESSAGES
1938 synchronize_locale (LC_MESSAGES, &Vprevious_messages_locale, 1942 synchronize_locale (LC_MESSAGES, &Vprevious_system_messages_locale,
1939 Vmessages_locale); 1943 Vsystem_messages_locale);
1940#endif 1944#endif
1941} 1945}
1942#endif /* HAVE_SETLOCALE */ 1946#endif /* HAVE_SETLOCALE */
@@ -2086,19 +2090,20 @@ installed locations, but we can find them\n\
2086near where the Emacs executable was found."); 2090near where the Emacs executable was found.");
2087 Vinstallation_directory = Qnil; 2091 Vinstallation_directory = Qnil;
2088 2092
2089 DEFVAR_LISP ("messages-locale", &Vmessages_locale, 2093 DEFVAR_LISP ("system-messages-locale", &Vsystem_messages_locale,
2090 "System locale for messages."); 2094 "System locale for messages.");
2091 Vmessages_locale = Qnil; 2095 Vsystem_messages_locale = Qnil;
2092 2096
2093 DEFVAR_LISP ("previous-messages-locale", &Vprevious_messages_locale, 2097 DEFVAR_LISP ("previous-system-messages-locale",
2098 &Vprevious_system_messages_locale,
2094 "Most recently used system locale for messages."); 2099 "Most recently used system locale for messages.");
2095 Vprevious_messages_locale = Qnil; 2100 Vprevious_system_messages_locale = Qnil;
2096 2101
2097 DEFVAR_LISP ("time-locale", &Vtime_locale, 2102 DEFVAR_LISP ("system-time-locale", &Vsystem_time_locale,
2098 "System locale for time."); 2103 "System locale for time.");
2099 Vtime_locale = Qnil; 2104 Vsystem_time_locale = Qnil;
2100 2105
2101 DEFVAR_LISP ("previous-time-locale", &Vprevious_time_locale, 2106 DEFVAR_LISP ("previous-system-time-locale", &Vprevious_system_time_locale,
2102 "Most recently used system locale for time."); 2107 "Most recently used system locale for time.");
2103 Vprevious_time_locale = Qnil; 2108 Vprevious_system_time_locale = Qnil;
2104} 2109}
diff --git a/src/fileio.c b/src/fileio.c
index 5a00649d79e..a91b2680ae8 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -65,8 +65,6 @@ Boston, MA 02111-1307, USA. */
65extern int errno; 65extern int errno;
66#endif 66#endif
67 67
68extern char *strerror ();
69
70#ifdef APOLLO 68#ifdef APOLLO
71#include <sys/time.h> 69#include <sys/time.h>
72#endif 70#endif
@@ -249,7 +247,7 @@ report_file_error (string, data)
249 Lisp_Object errstring; 247 Lisp_Object errstring;
250 int errorno = errno; 248 int errorno = errno;
251 249
252 synchronize_messages_locale (); 250 synchronize_system_messages_locale ();
253 errstring = code_convert_string_norecord (build_string (strerror (errorno)), 251 errstring = code_convert_string_norecord (build_string (strerror (errorno)),
254 Vlocale_coding_system, 0); 252 Vlocale_coding_system, 0);
255 253
diff --git a/src/gmalloc.c b/src/gmalloc.c
index b291903fa50..9bf84235ee5 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -36,7 +36,7 @@ Cambridge, MA 02139, USA.
36#include <config.h> 36#include <config.h>
37#endif 37#endif
38 38
39#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) 39#if defined __cplusplus || (defined (__STDC__) && __STDC__) || defined STDC_HEADERS
40#undef PP 40#undef PP
41#define PP(args) args 41#define PP(args) args
42#undef __ptr_t 42#undef __ptr_t
@@ -44,10 +44,6 @@ Cambridge, MA 02139, USA.
44#else /* Not C++ or ANSI C. */ 44#else /* Not C++ or ANSI C. */
45#undef PP 45#undef PP
46#define PP(args) () 46#define PP(args) ()
47#ifndef HAVE_CONFIG_H
48#undef const
49#define const
50#endif
51#undef __ptr_t 47#undef __ptr_t
52#define __ptr_t char * 48#define __ptr_t char *
53#endif /* C++ or ANSI C. */ 49#endif /* C++ or ANSI C. */
@@ -63,13 +59,12 @@ Cambridge, MA 02139, USA.
63#endif 59#endif
64#endif 60#endif
65 61
66#if defined (__GNU_LIBRARY__) || (defined (__STDC__) && __STDC__) 62#ifdef HAVE_LIMITS_H
67#include <limits.h> 63#include <limits.h>
68#else 64#endif
69#ifndef CHAR_BIT 65#ifndef CHAR_BIT
70#define CHAR_BIT 8 66#define CHAR_BIT 8
71#endif 67#endif
72#endif
73 68
74#ifdef HAVE_UNISTD_H 69#ifdef HAVE_UNISTD_H
75#include <unistd.h> 70#include <unistd.h>
@@ -83,7 +78,7 @@ extern "C"
83{ 78{
84#endif 79#endif
85 80
86#if defined (__STDC__) && __STDC__ 81#ifdef STDC_HEADERS
87#include <stddef.h> 82#include <stddef.h>
88#define __malloc_size_t size_t 83#define __malloc_size_t size_t
89#define __malloc_ptrdiff_t ptrdiff_t 84#define __malloc_ptrdiff_t ptrdiff_t
@@ -96,6 +91,10 @@ extern "C"
96#define NULL 0 91#define NULL 0
97#endif 92#endif
98 93
94#ifndef FREE_RETURN_TYPE
95#define FREE_RETURN_TYPE void
96#endif
97
99 98
100/* Allocate SIZE bytes of memory. */ 99/* Allocate SIZE bytes of memory. */
101extern __ptr_t malloc PP ((__malloc_size_t __size)); 100extern __ptr_t malloc PP ((__malloc_size_t __size));
@@ -105,7 +104,7 @@ extern __ptr_t realloc PP ((__ptr_t __ptr, __malloc_size_t __size));
105/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ 104/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
106extern __ptr_t calloc PP ((__malloc_size_t __nmemb, __malloc_size_t __size)); 105extern __ptr_t calloc PP ((__malloc_size_t __nmemb, __malloc_size_t __size));
107/* Free a block allocated by `malloc', `realloc' or `calloc'. */ 106/* Free a block allocated by `malloc', `realloc' or `calloc'. */
108extern void free PP ((__ptr_t __ptr)); 107extern FREE_RETURN_TYPE free PP ((__ptr_t __ptr));
109 108
110/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ 109/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
111#if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */ 110#if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */
@@ -1128,7 +1127,8 @@ _free_internal (ptr)
1128} 1127}
1129 1128
1130/* Return memory to the heap. */ 1129/* Return memory to the heap. */
1131void 1130
1131FREE_RETURN_TYPE
1132free (ptr) 1132free (ptr)
1133 __ptr_t ptr; 1133 __ptr_t ptr;
1134{ 1134{
diff --git a/src/lisp.h b/src/lisp.h
index d48ec29461d..046f55e528e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2588,13 +2588,13 @@ extern Lisp_Object Vinstallation_directory;
2588EXFUN (Fkill_emacs, 1); 2588EXFUN (Fkill_emacs, 1);
2589#if HAVE_SETLOCALE 2589#if HAVE_SETLOCALE
2590void fixup_locale P_ ((void)); 2590void fixup_locale P_ ((void));
2591void synchronize_messages_locale P_ ((void)); 2591void synchronize_system_messages_locale P_ ((void));
2592void synchronize_time_locale P_ ((void)); 2592void synchronize_system_time_locale P_ ((void));
2593#else 2593#else
2594#define setlocale(category, locale) 2594#define setlocale(category, locale)
2595#define fixup_locale() 2595#define fixup_locale()
2596#define synchronize_messages_locale() 2596#define synchronize_system_messages_locale()
2597#define synchronize_time_locale() 2597#define synchronize_system_time_locale()
2598#endif 2598#endif
2599void shut_down_emacs P_ ((int, int, Lisp_Object)); 2599void shut_down_emacs P_ ((int, int, Lisp_Object));
2600/* Nonzero means don't do interactive redisplay and don't change tty modes */ 2600/* Nonzero means don't do interactive redisplay and don't change tty modes */
diff --git a/src/process.c b/src/process.c
index 463dc44be2f..9fa3c19df2d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -146,7 +146,6 @@ Lisp_Object Qlast_nonmenu_event;
146extern void set_waiting_for_input P_ ((EMACS_TIME *)); 146extern void set_waiting_for_input P_ ((EMACS_TIME *));
147 147
148extern int errno; 148extern int errno;
149extern char *strerror ();
150#ifdef VMS 149#ifdef VMS
151extern char *sys_errlist[]; 150extern char *sys_errlist[];
152#endif 151#endif
@@ -155,50 +154,6 @@ extern char *sys_errlist[];
155extern int h_errno; 154extern int h_errno;
156#endif 155#endif
157 156
158#ifndef HAVE_STRSIGNAL
159#ifndef SYS_SIGLIST_DECLARED
160#ifndef VMS
161#ifndef BSD4_1
162#ifndef WINDOWSNT
163#ifndef LINUX
164extern char *sys_siglist[];
165#endif /* not LINUX */
166#else /* BSD4_1 */
167char *sys_siglist[] =
168 {
169 "bum signal!!",
170 "hangup",
171 "interrupt",
172 "quit",
173 "illegal instruction",
174 "trace trap",
175 "iot instruction",
176 "emt instruction",
177 "floating point exception",
178 "kill",
179 "bus error",
180 "segmentation violation",
181 "bad argument to system call",
182 "write on a pipe with no one to read it",
183 "alarm clock",
184 "software termination signal from kill",
185 "status signal",
186 "sendable stop signal not from tty",
187 "stop signal from tty",
188 "continue a stopped process",
189 "child status has changed",
190 "background read attempted from control tty",
191 "background write attempted from control tty",
192 "input record available at control tty",
193 "exceeded CPU time limit",
194 "exceeded file size limit"
195 };
196#endif /* not WINDOWSNT */
197#endif
198#endif /* VMS */
199#endif /* ! SYS_SIGLIST_DECLARED */
200#endif /* ! HAVE_STRSIGNAL */
201
202/* t means use pty, nil means use a pipe, 157/* t means use pty, nil means use a pipe,
203 maybe other values to come. */ 158 maybe other values to come. */
204static Lisp_Object Vprocess_connection_type; 159static Lisp_Object Vprocess_connection_type;
@@ -360,7 +315,7 @@ status_message (status)
360 if (EQ (symbol, Qsignal) || EQ (symbol, Qstop)) 315 if (EQ (symbol, Qsignal) || EQ (symbol, Qstop))
361 { 316 {
362 char *signame; 317 char *signame;
363 synchronize_messages_locale (); 318 synchronize_system_messages_locale ();
364 signame = strsignal (code); 319 signame = strsignal (code);
365 if (signame == 0) 320 if (signame == 0)
366 signame = "unknown"; 321 signame = "unknown";
@@ -4254,7 +4209,7 @@ sigchld_handler (signo)
4254 int code = WTERMSIG (w); 4209 int code = WTERMSIG (w);
4255 char *signame; 4210 char *signame;
4256 4211
4257 synchronize_messages_locale (); 4212 synchronize_system_messages_locale ();
4258 signame = strsignal (code); 4213 signame = strsignal (code);
4259 4214
4260 if (signame == 0) 4215 if (signame == 0)
diff --git a/src/syntax.c b/src/syntax.c
index da28d6eed6d..d08c29bab53 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -25,7 +25,6 @@ Boston, MA 02111-1307, USA. */
25#include "commands.h" 25#include "commands.h"
26#include "buffer.h" 26#include "buffer.h"
27#include "charset.h" 27#include "charset.h"
28#include <assert.h>
29 28
30/* Make syntax table lookup grant data in gl_state. */ 29/* Make syntax table lookup grant data in gl_state. */
31#define SYNTAX_ENTRY_VIA_PROPERTY 30#define SYNTAX_ENTRY_VIA_PROPERTY
@@ -2612,7 +2611,8 @@ do { prev_from = from; \
2612 goto commentloop; 2611 goto commentloop;
2613 2612
2614 case Scomment: 2613 case Scomment:
2615 assert (state.incomment != 0); /* state.incomment = -1; */ 2614 if (! state.incomment)
2615 abort ();
2616 if (commentstop || boundary_stop) goto done; 2616 if (commentstop || boundary_stop) goto done;
2617 commentloop: 2617 commentloop:
2618 /* The (from == BEGV) test is to enter the loop in the middle so 2618 /* The (from == BEGV) test is to enter the loop in the middle so
diff --git a/src/sysdep.c b/src/sysdep.c
index 1a3123d7ac6..bce69a406ff 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2771,13 +2771,6 @@ sigbit (i)
2771 2771
2772sigset_t empty_mask, full_mask; 2772sigset_t empty_mask, full_mask;
2773 2773
2774void
2775init_signals ()
2776{
2777 sigemptyset (&empty_mask);
2778 sigfillset (&full_mask);
2779}
2780
2781signal_handler_t 2774signal_handler_t
2782sys_signal (int signal_number, signal_handler_t action) 2775sys_signal (int signal_number, signal_handler_t action)
2783{ 2776{
@@ -2840,6 +2833,185 @@ sys_sigsetmask (sigset_t new_mask)
2840 2833
2841#endif /* POSIX_SIGNALS */ 2834#endif /* POSIX_SIGNALS */
2842 2835
2836#if !defined HAVE_STRSIGNAL && !defined SYS_SIGLIST_DECLARED
2837static char *my_sys_siglist[NSIG];
2838# ifdef sys_siglist
2839# undef sys_siglist
2840# endif
2841# define sys_siglist my_sys_siglist
2842#endif
2843
2844void
2845init_signals ()
2846{
2847#ifdef POSIX_SIGNALS
2848 sigemptyset (&empty_mask);
2849 sigfillset (&full_mask);
2850#endif
2851
2852#if !defined HAVE_STRSIGNAL && !defined SYS_SIGLIST_DECLARED
2853 if (! initialized)
2854 {
2855# ifdef SIGABRT
2856 sys_siglist[SIGABRT] = "Aborted";
2857# endif
2858# ifdef SIGAIO
2859 sys_siglist[SIGAIO] = "LAN I/O interrupt";
2860# endif
2861# ifdef SIGALRM
2862 sys_siglist[SIGALRM] = "Alarm clock";
2863# endif
2864# ifdef SIGBUS
2865 sys_siglist[SIGBUS] = "Bus error";
2866# endif
2867# ifdef SIGCLD
2868 sys_siglist[SIGCLD] = "Child status changed";
2869# endif
2870# ifdef SIGCHLD
2871 sys_siglist[SIGCHLD] = "Child status changed";
2872# endif
2873# ifdef SIGCONT
2874 sys_siglist[SIGCONT] = "Continued";
2875# endif
2876# ifdef SIGDANGER
2877 sys_siglist[SIGDANGER] = "Swap space dangerously low";
2878# endif
2879# ifdef SIGDGNOTIFY
2880 sys_siglist[SIGDGNOTIFY] = "Notification message in queue";
2881# endif
2882# ifdef SIGEMT
2883 sys_siglist[SIGEMT] = "Emulation trap";
2884# endif
2885# ifdef SIGFPE
2886 sys_siglist[SIGFPE] = "Arithmetic exception";
2887# endif
2888# ifdef SIGFREEZE
2889 sys_siglist[SIGFREEZE] = "SIGFREEZE";
2890# endif
2891# ifdef SIGGRANT
2892 sys_siglist[SIGGRANT] = "Monitor mode granted";
2893# endif
2894# ifdef SIGHUP
2895 sys_siglist[SIGHUP] = "Hangup";
2896# endif
2897# ifdef SIGILL
2898 sys_siglist[SIGILL] = "Illegal instruction";
2899# endif
2900# ifdef SIGINT
2901 sys_siglist[SIGINT] = "Interrupt";
2902# endif
2903# ifdef SIGIO
2904 sys_siglist[SIGIO] = "I/O possible";
2905# endif
2906# ifdef SIGIOINT
2907 sys_siglist[SIGIOINT] = "I/O intervention required";
2908# endif
2909# ifdef SIGIOT
2910 sys_siglist[SIGIOT] = "IOT trap";
2911# endif
2912# ifdef SIGKILL
2913 sys_siglist[SIGKILL] = "Killed";
2914# endif
2915# ifdef SIGLOST
2916 sys_siglist[SIGLOST] = "Resource lost";
2917# endif
2918# ifdef SIGLWP
2919 sys_siglist[SIGLWP] = "SIGLWP";
2920# endif
2921# ifdef SIGMSG
2922 sys_siglist[SIGMSG] = "Monitor mode data available";
2923# endif
2924# ifdef SIGPHONE
2925 sys_siglist[SIGWIND] = "SIGPHONE";
2926# endif
2927# ifdef SIGPIPE
2928 sys_siglist[SIGPIPE] = "Broken pipe";
2929# endif
2930# ifdef SIGPOLL
2931 sys_siglist[SIGPOLL] = "Pollable event occurred";
2932# endif
2933# ifdef SIGPROF
2934 sys_siglist[SIGPROF] = "Profiling timer expired";
2935# endif
2936# ifdef SIGPTY
2937 sys_siglist[SIGPTY] = "PTY I/O interrupt";
2938# endif
2939# ifdef SIGPWR
2940 sys_siglist[SIGPWR] = "Power-fail restart";
2941# endif
2942# ifdef SIGQUIT
2943 sys_siglist[SIGQUIT] = "Quit";
2944# endif
2945# ifdef SIGRETRACT
2946 sys_siglist[SIGRETRACT] = "Need to relinguish monitor mode";
2947# endif
2948# ifdef SIGSAK
2949 sys_siglist[SIGSAK] = "Secure attention";
2950# endif
2951# ifdef SIGSEGV
2952 sys_siglist[SIGSEGV] = "Segmentation violation";
2953# endif
2954# ifdef SIGSOUND
2955 sys_siglist[SIGSOUND] = "Sound completed";
2956# endif
2957# ifdef SIGSTOP
2958 sys_siglist[SIGSTOP] = "Stopped (signal)";
2959# endif
2960# ifdef SIGSTP
2961 sys_siglist[SIGSTP] = "Stopped (user)";
2962# endif
2963# ifdef SIGSYS
2964 sys_siglist[SIGSYS] = "Bad argument to system call";
2965# endif
2966# ifdef SIGTERM
2967 sys_siglist[SIGTERM] = "Terminated";
2968# endif
2969# ifdef SIGTHAW
2970 sys_siglist[SIGTHAW] = "SIGTHAW";
2971# endif
2972# ifdef SIGTRAP
2973 sys_siglist[SIGTRAP] = "Trace/breakpoint trap";
2974# endif
2975# ifdef SIGTSTP
2976 sys_siglist[SIGTSTP] = "Stopped (user)";
2977# endif
2978# ifdef SIGTTIN
2979 sys_siglist[SIGTTIN] = "Stopped (tty input)";
2980# endif
2981# ifdef SIGTTOU
2982 sys_siglist[SIGTTOU] = "Stopped (tty output)";
2983# endif
2984# ifdef SIGURG
2985 sys_siglist[SIGURG] = "Urgent I/O condition";
2986# endif
2987# ifdef SIGUSR1
2988 sys_siglist[SIGUSR1] = "User defined signal 1";
2989# endif
2990# ifdef SIGUSR2
2991 sys_siglist[SIGUSR2] = "User defined signal 2";
2992# endif
2993# ifdef SIGVTALRM
2994 sys_siglist[SIGVTALRM] = "Virtual timer expired";
2995# endif
2996# ifdef SIGWAITING
2997 sys_siglist[SIGWAITING] = "Process's LWPs are blocked";
2998# endif
2999# ifdef SIGWINCH
3000 sys_siglist[SIGWINCH] = "Window size changed";
3001# endif
3002# ifdef SIGWIND
3003 sys_siglist[SIGWIND] = "SIGWIND";
3004# endif
3005# ifdef SIGXCPU
3006 sys_siglist[SIGXCPU] = "CPU time limit exceeded";
3007# endif
3008# ifdef SIGXFSZ
3009 sys_siglist[SIGXFSZ] = "File size limit exceeded";
3010# endif
3011 }
3012#endif /* !defined HAVE_STRSIGNAL && !defined SYS_SIGLIST_DECLARED */
3013}
3014
2843#ifndef HAVE_RANDOM 3015#ifndef HAVE_RANDOM
2844#ifdef random 3016#ifdef random
2845#define HAVE_RANDOM 3017#define HAVE_RANDOM
@@ -3156,95 +3328,6 @@ vfork ()
3156 * always negligible. Fred Fish, Unisoft Systems Inc. 3328 * always negligible. Fred Fish, Unisoft Systems Inc.
3157 */ 3329 */
3158 3330
3159#ifndef HAVE_STRSIGNAL
3160#ifndef HAVE_SYS_SIGLIST
3161char *sys_siglist[NSIG + 1] =
3162{
3163#ifdef AIX
3164/* AIX has changed the signals a bit */
3165 "bogus signal", /* 0 */
3166 "hangup", /* 1 SIGHUP */
3167 "interrupt", /* 2 SIGINT */
3168 "quit", /* 3 SIGQUIT */
3169 "illegal instruction", /* 4 SIGILL */
3170 "trace trap", /* 5 SIGTRAP */
3171 "IOT instruction", /* 6 SIGIOT */
3172 "crash likely", /* 7 SIGDANGER */
3173 "floating point exception", /* 8 SIGFPE */
3174 "kill", /* 9 SIGKILL */
3175 "bus error", /* 10 SIGBUS */
3176 "segmentation violation", /* 11 SIGSEGV */
3177 "bad argument to system call", /* 12 SIGSYS */
3178 "write on a pipe with no one to read it", /* 13 SIGPIPE */
3179 "alarm clock", /* 14 SIGALRM */
3180 "software termination signum", /* 15 SIGTERM */
3181 "user defined signal 1", /* 16 SIGUSR1 */
3182 "user defined signal 2", /* 17 SIGUSR2 */
3183 "death of a child", /* 18 SIGCLD */
3184 "power-fail restart", /* 19 SIGPWR */
3185 "bogus signal", /* 20 */
3186 "bogus signal", /* 21 */
3187 "bogus signal", /* 22 */
3188 "bogus signal", /* 23 */
3189 "bogus signal", /* 24 */
3190 "LAN I/O interrupt", /* 25 SIGAIO */
3191 "PTY I/O interrupt", /* 26 SIGPTY */
3192 "I/O intervention required", /* 27 SIGIOINT */
3193#ifdef AIXHFT
3194 "HFT grant", /* 28 SIGGRANT */
3195 "HFT retract", /* 29 SIGRETRACT */
3196 "HFT sound done", /* 30 SIGSOUND */
3197 "HFT input ready", /* 31 SIGMSG */
3198#endif
3199#else /* not AIX */
3200 "bogus signal", /* 0 */
3201 "hangup", /* 1 SIGHUP */
3202 "interrupt", /* 2 SIGINT */
3203 "quit", /* 3 SIGQUIT */
3204 "illegal instruction", /* 4 SIGILL */
3205 "trace trap", /* 5 SIGTRAP */
3206 "IOT instruction", /* 6 SIGIOT */
3207 "EMT instruction", /* 7 SIGEMT */
3208 "floating point exception", /* 8 SIGFPE */
3209 "kill", /* 9 SIGKILL */
3210 "bus error", /* 10 SIGBUS */
3211 "segmentation violation", /* 11 SIGSEGV */
3212 "bad argument to system call", /* 12 SIGSYS */
3213 "write on a pipe with no one to read it", /* 13 SIGPIPE */
3214 "alarm clock", /* 14 SIGALRM */
3215 "software termination signum", /* 15 SIGTERM */
3216 "user defined signal 1", /* 16 SIGUSR1 */
3217 "user defined signal 2", /* 17 SIGUSR2 */
3218 "death of a child", /* 18 SIGCLD */
3219 "power-fail restart", /* 19 SIGPWR */
3220#ifdef sun
3221 "window size change", /* 20 SIGWINCH */
3222 "urgent socket condition", /* 21 SIGURG */
3223 "pollable event occurred", /* 22 SIGPOLL */
3224 "stop (cannot be caught or ignored)", /* 23 SIGSTOP */
3225 "user stop requested from tty", /* 24 SIGTSTP */
3226 "stopped process has been continued", /* 25 SIGCONT */
3227 "background tty read attempted", /* 26 SIGTTIN */
3228 "background tty write attempted", /* 27 SIGTTOU */
3229 "virtual timer expired", /* 28 SIGVTALRM */
3230 "profiling timer expired", /* 29 SIGPROF */
3231 "exceeded cpu limit", /* 30 SIGXCPU */
3232 "exceeded file size limit", /* 31 SIGXFSZ */
3233 "process's lwps are blocked", /* 32 SIGWAITING */
3234 "special signal used by thread library", /* 33 SIGLWP */
3235#ifdef SIGFREEZE
3236 "Special Signal Used By CPR", /* 34 SIGFREEZE */
3237#endif
3238#ifdef SIGTHAW
3239 "Special Signal Used By CPR", /* 35 SIGTHAW */
3240#endif
3241#endif /* sun */
3242#endif /* not AIX */
3243 0
3244 };
3245#endif /* HAVE_SYS_SIGLIST */
3246#endif /* HAVE_STRSIGNAL */
3247
3248/* 3331/*
3249 * Warning, this function may not duplicate 4.2 action properly 3332 * Warning, this function may not duplicate 4.2 action properly
3250 * under error conditions. 3333 * under error conditions.
@@ -3396,82 +3479,6 @@ croak (badfunc)
3396 3479
3397#endif /* USG */ 3480#endif /* USG */
3398 3481
3399#ifdef DGUX
3400
3401#ifndef HAVE_STRSIGNAL
3402char *sys_siglist[NSIG + 1] =
3403{
3404 "null signal", /* 0 SIGNULL */
3405 "hangup", /* 1 SIGHUP */
3406 "interrupt", /* 2 SIGINT */
3407 "quit", /* 3 SIGQUIT */
3408 "illegal instruction", /* 4 SIGILL */
3409 "trace trap", /* 5 SIGTRAP */
3410 "abort termination", /* 6 SIGABRT */
3411 "SIGEMT", /* 7 SIGEMT */
3412 "floating point exception", /* 8 SIGFPE */
3413 "kill", /* 9 SIGKILL */
3414 "bus error", /* 10 SIGBUS */
3415 "segmentation violation", /* 11 SIGSEGV */
3416 "bad argument to system call", /* 12 SIGSYS */
3417 "write on a pipe with no reader", /* 13 SIGPIPE */
3418 "alarm clock", /* 14 SIGALRM */
3419 "software termination signal", /* 15 SIGTERM */
3420 "user defined signal 1", /* 16 SIGUSR1 */
3421 "user defined signal 2", /* 17 SIGUSR2 */
3422 "child stopped or terminated", /* 18 SIGCLD */
3423 "power-fail restart", /* 19 SIGPWR */
3424 "window size changed", /* 20 SIGWINCH */
3425 "undefined", /* 21 */
3426 "pollable event occurred", /* 22 SIGPOLL */
3427 "sendable stop signal not from tty", /* 23 SIGSTOP */
3428 "stop signal from tty", /* 24 SIGSTP */
3429 "continue a stopped process", /* 25 SIGCONT */
3430 "attempted background tty read", /* 26 SIGTTIN */
3431 "attempted background tty write", /* 27 SIGTTOU */
3432 "undefined", /* 28 */
3433 "undefined", /* 29 */
3434 "undefined", /* 30 */
3435 "undefined", /* 31 */
3436 "undefined", /* 32 */
3437 "socket (TCP/IP) urgent data arrival", /* 33 SIGURG */
3438 "I/O is possible", /* 34 SIGIO */
3439 "exceeded cpu time limit", /* 35 SIGXCPU */
3440 "exceeded file size limit", /* 36 SIGXFSZ */
3441 "virtual time alarm", /* 37 SIGVTALRM */
3442 "profiling time alarm", /* 38 SIGPROF */
3443 "undefined", /* 39 */
3444 "file record locks revoked", /* 40 SIGLOST */
3445 "undefined", /* 41 */
3446 "undefined", /* 42 */
3447 "undefined", /* 43 */
3448 "undefined", /* 44 */
3449 "undefined", /* 45 */
3450 "undefined", /* 46 */
3451 "undefined", /* 47 */
3452 "undefined", /* 48 */
3453 "undefined", /* 49 */
3454 "undefined", /* 50 */
3455 "undefined", /* 51 */
3456 "undefined", /* 52 */
3457 "undefined", /* 53 */
3458 "undefined", /* 54 */
3459 "undefined", /* 55 */
3460 "undefined", /* 56 */
3461 "undefined", /* 57 */
3462 "undefined", /* 58 */
3463 "undefined", /* 59 */
3464 "undefined", /* 60 */
3465 "undefined", /* 61 */
3466 "undefined", /* 62 */
3467 "undefined", /* 63 */
3468 "notification message in mess. queue", /* 64 SIGDGNOTIFY */
3469 0
3470};
3471#endif /* HAVE_STRSIGNAL */
3472
3473#endif /* DGUX */
3474
3475/* Directory routines for systems that don't have them. */ 3482/* Directory routines for systems that don't have them. */
3476 3483
3477#ifdef SYSV_SYSTEM_DIR 3484#ifdef SYSV_SYSTEM_DIR
@@ -6374,33 +6381,6 @@ getenv (const char * name)
6374} 6381}
6375 6382
6376#ifdef __MRC__ 6383#ifdef __MRC__
6377/* see Interfaces&Libraries:Interfaces:CIncludes:signal.h */
6378char *sys_siglist[] =
6379{
6380 "Zero is not a signal!!!",
6381 "Abort", /* 1 */
6382 "Interactive user interrupt", /* 2 */ "BAD",
6383 "Floating point exception", /* 4 */ "BAD", "BAD", "BAD",
6384 "Illegal instruction", /* 8 */ "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD",
6385 "Segment violation", /* 16 */ "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD", "BAD",
6386 "Terminal" /* 32 */
6387};
6388#elif __MWERKS__
6389char *sys_siglist[] =
6390{
6391 "Zero is not a signal!!!",
6392 "Abort",
6393 "Floating point exception",
6394 "Illegal instruction",
6395 "Interactive user interrupt",
6396 "Segment violation",
6397 "Terminal"
6398};
6399#else
6400You lose!!!
6401#endif
6402
6403#ifdef __MRC__
6404#include <utsname.h> 6384#include <utsname.h>
6405 6385
6406int 6386int
diff --git a/src/w32proc.c b/src/w32proc.c
index 8a188015d85..21bdebbbecc 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -544,7 +544,7 @@ get_result:
544 int code = WTERMSIG (retval); 544 int code = WTERMSIG (retval);
545 char *signame; 545 char *signame;
546 546
547 synchronize_messages_locale (); 547 synchronize_system_messages_locale ();
548 signame = strsignal (code); 548 signame = strsignal (code);
549 549
550 if (signame == 0) 550 if (signame == 0)
diff --git a/src/xfns.c b/src/xfns.c
index ffa8e6e495f..f915fa701bc 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -52,9 +52,6 @@ Boston, MA 02111-1307, USA. */
52 52
53#ifdef HAVE_X_WINDOWS 53#ifdef HAVE_X_WINDOWS
54 54
55#ifndef STDC_HEADERS
56extern void abort ();
57#endif
58#include <ctype.h> 55#include <ctype.h>
59 56
60/* On some systems, the character-composition stuff is broken in X11R5. */ 57/* On some systems, the character-composition stuff is broken in X11R5. */