summaryrefslogtreecommitdiff
path: root/guile-readline/readline.c
diff options
context:
space:
mode:
authorNeil Jerram <neil@ossau.uklinux.net>2009-06-18 20:35:45 +0100
committerNeil Jerram <neil@ossau.uklinux.net>2009-06-23 23:04:41 +0100
commit0ebbcf43c45892afcec199bde0ca1ecaea0077da (patch)
tree6fb7c5d453e1e34857c710edc84fcb662e2643cc /guile-readline/readline.c
parent0d646345f477f0ffced6f602370fc8c607f7d32f (diff)
downloadguile-0ebbcf43c45892afcec199bde0ca1ecaea0077da.tar.gz
Remove AC_SYS_RESTARTABLE_SYSCALLS and related code
As the Autoconf documentation says, "These days portable programs [...] should not rely on `HAVE_RESTARTABLE_SYSCALLS', since nowadays whether a system call is restartable is a dynamic issue, not a configuration-time issue." In other words, if we ever rely on HAVE_RESTARTABLE_SYSCALLS, we are at the mercy of any code that Guile happens to be linked with, because that code could install a signal handler without the SA_RESTART flag, and then a Guile system call could unexpectedly return EINTR. The readline part of this goes back to this problem report: http://sources.redhat.com/ml/guile/2000-05/msg00177.html; and is an excellent example of the above paragraph. It was noted during the discussion that undefining HAVE_RESTARTABLE_SYSCALLS would fix the problem, but that solution wasn't adopted - I guess because Guile was still using cooperative threads then (not pthreads) and so there was a significant concern (whether founded or not) that not using restartable syscalls (where available) could lead to a loss of performance. Now Guile's default mode of operation is with pthreads, where we already don't assume that HAVE_RESTARTABLE_SYSCALLS is reliable, so there is no possible further performance loss. And in any case we really have no choice, if we want correct operation. Thanks to Sylvain Beucler for reporting this and suggesting the fix. * configure.in (AC_SYS_RESTARTABLE_SYSCALLS): Removed. * doc/ref/posix.texi (Signals): Remove statement that Guile always sets SA_RESTART flag. * guile-readline/configure.in (GUILE_SIGWINCH_SA_RESTART_CLEARED): Remove this setting, together with its test code. (HAVE_RL_PRE_INPUT_HOOK): Remove this setting and its code, as no longer needed. * guile-readline/readline.c (sigwinch_enable_restart): Removed. (scm_init_readline): Remove setting of rl_pre_input_hook. * libguile/_scm.h (SCM_SYSCALL): Remove the definition that relies on HAVE_RESTARTABLE_SYSCALLS. * libguile/scmsigs.c (scm_sigaction_for_thread): Don't always set the SA_RESTART flag if available. Update docstring accordingly. (scm_init_scmsigs): Remove code that sets SA_RESTART flag for all signals. * THANKS: Add Sylvain.
Diffstat (limited to 'guile-readline/readline.c')
-rw-r--r--guile-readline/readline.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/guile-readline/readline.c b/guile-readline/readline.c
index 84ae62260..7f86ceb3d 100644
--- a/guile-readline/readline.c
+++ b/guile-readline/readline.c
@@ -530,26 +530,6 @@ match_paren (int x, int k)
}
#endif /* HAVE_RL_GET_KEYMAP */
-#if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED)
-/* Readline disables SA_RESTART on SIGWINCH.
- * This code turns it back on.
- */
-static int
-sigwinch_enable_restart (void)
-{
-#ifdef HAVE_SIGINTERRUPT
- siginterrupt (SIGWINCH, 0);
-#else
- struct sigaction action;
-
- sigaction (SIGWINCH, NULL, &action);
- action.sa_flags |= SA_RESTART;
- sigaction (SIGWINCH, &action, NULL);
-#endif
- return 0;
-}
-#endif
-
#endif /* HAVE_RL_GETC_FUNCTION */
void
@@ -569,9 +549,6 @@ scm_init_readline ()
#endif
rl_basic_word_break_characters = "\t\n\"'`;()";
rl_readline_name = "Guile";
-#if defined (HAVE_RL_PRE_INPUT_HOOK) && defined (GUILE_SIGWINCH_SA_RESTART_CLEARED)
- rl_pre_input_hook = sigwinch_enable_restart;
-#endif
reentry_barrier_mutex = scm_permanent_object (scm_make_mutex ());
scm_init_opts (scm_readline_options,