[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-0-22-g0eb

From: Neil Jerram
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-0-22-g0ebbcf4
Date: Tue, 23 Jun 2009 22:07:55 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

The branch, master has been updated
       via  0ebbcf43c45892afcec199bde0ca1ecaea0077da (commit)
      from  0d646345f477f0ffced6f602370fc8c607f7d32f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0ebbcf43c45892afcec199bde0ca1ecaea0077da
Author: Neil Jerram <address@hidden>
Date:   Thu Jun 18 20:35:45 2009 +0100

    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:; 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
    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.
    * doc/ref/posix.texi (Signals): Remove statement that Guile always
      sets SA_RESTART flag.
    * guile-readline/ (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
    * 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
    * THANKS: Add Sylvain.


Summary of changes:
 THANKS                      |    1 +                |   12 -------
 doc/ref/posix.texi          |    4 --
 guile-readline/ |   71 -------------------------------------------
 guile-readline/readline.c   |   23 --------------
 libguile/_scm.h             |   14 --------
 libguile/scmsigs.c          |   36 +--------------------
 7 files changed, 3 insertions(+), 158 deletions(-)

diff --git a/THANKS b/THANKS
index 90ccd87..47aa93c 100644
--- a/THANKS
+++ b/THANKS
@@ -24,6 +24,7 @@ For fixes or providing information which led to a fix:
           David Allouche
         Martin Baulig
         Fabrice Bauzac
+        Sylvain Beucler
           Carlo Bramini
             Rob Browning
          Adrian Bunk
diff --git a/ b/
index 1c4cf5f..73fc153 100644
--- a/
+++ b/
@@ -1054,18 +1054,6 @@ if test $guile_cv_localtime_cache = yes; then
   AC_DEFINE(LOCALTIME_CACHE, 1, [Define if localtime caches the TZ setting.])
-dnl Test whether system calls are restartable by default on the
-dnl current system.  If they are not, we put a loop around every system
-dnl call to check for EINTR (see SCM_SYSCALL) and do not attempt to
-dnl change from the default behaviour.  On the other hand, if signals
-dnl are restartable then the loop is not installed and when libguile
-dnl initialises it also resets the behaviour of each signal to cause a
-dnl restart (in case a different runtime had a different default
-dnl behaviour for some reason: e.g., different versions of linux seem
-dnl to behave differently.)
 if test "$enable_regex" = yes; then
    if test "$ac_cv_header_regex_h" = yes ||
       test "$ac_cv_header_rxposix_h" = yes ||
diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
index cb19a7a..2d64919 100644
--- a/doc/ref/posix.texi
+++ b/doc/ref/posix.texi
@@ -1909,10 +1909,6 @@ for termination, not stopping.
 If a signal occurs while in a system call, deliver the signal then
 restart the system call (as opposed to returning an @code{EINTR} error
 from that call).
-Guile always enables this flag where available, no matter what
address@hidden are specified.  This avoids spurious error returns in low
-level operations.
 @end defvar
 The return value is a pair with information about the old handler as
diff --git a/guile-readline/ b/guile-readline/
index d053566..f24fc94 100644
--- a/guile-readline/
+++ b/guile-readline/
@@ -54,77 +54,6 @@ dnl install paren matching on the Guile command line (when 
 dnl readline for input), so it's completely optional.
-dnl Check for rl_pre_input_hook.  This is more complicated because on
-dnl some systems (HP/UX), the linker wont let us treat
-dnl rl_pre_input_hook as a function when it really is a function
-dnl pointer.
-AC_MSG_CHECKING([for rl_pre_input_hook])
-#include <stdio.h>
-#include <readline/readline.h>
-], [
-rl_pre_input_hook = 0;
-if test $ac_cv_var_rl_pre_input_hook = yes; then
-            [Define if rl_pre_input_hook is available.])
-AC_MSG_CHECKING(if readline clears SA_RESTART flag for SIGWINCH)
-AC_TRY_RUN([#include <signal.h>
-#include <stdio.h>
-#include <readline/readline.h>
-hook ()
-  struct sigaction action;
-  sigaction (SIGWINCH, NULL, &action);
-  rl_cleanup_after_signal();
-  /* exit with 0 if readline disabled SA_RESTART */
-  exit (action.sa_flags & SA_RESTART);
-main ()
-  struct sigaction action;
-  sigaction (SIGWINCH, NULL, &action);
-  action.sa_flags |= SA_RESTART;
-  sigaction (SIGWINCH, &action, NULL);
-  /* Give readline something to read.  Otherwise, it might hang, for
-     example when run as a background process with job control.
-  */
-  rl_instream = fopen ("/dev/null", "r");
-  if (rl_instream == NULL)
-    {
-      perror ("/dev/null");
-      exit (1);
-    }
-  rl_pre_input_hook = hook;
-  readline ("");
-if test $guile_cv_sigwinch_sa_restart_cleared = yes; then
-    [Define if readline disables SA_RESTART.])
 AC_CACHE_CHECK([for rl_getc_function pointer in readline],
diff --git a/guile-readline/readline.c b/guile-readline/readline.c
index 84ae622..7f86ceb 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 
-/* Readline disables SA_RESTART on SIGWINCH.
- * This code turns it back on.
- */
-static int
-sigwinch_enable_restart (void)
-  siginterrupt (SIGWINCH, 0);
-  struct sigaction action;
-  sigaction (SIGWINCH, NULL, &action);
-  action.sa_flags |= SA_RESTART;
-  sigaction (SIGWINCH, &action, NULL);
-  return 0;
@@ -569,9 +549,6 @@ scm_init_readline ()
   rl_basic_word_break_characters = "\t\n\"'`;()";
   rl_readline_name = "Guile";
-#if defined (HAVE_RL_PRE_INPUT_HOOK) && defined 
-  rl_pre_input_hook = sigwinch_enable_restart;
   reentry_barrier_mutex = scm_permanent_object (scm_make_mutex ());
   scm_init_opts (scm_readline_options,
diff --git a/libguile/_scm.h b/libguile/_scm.h
index 1a0a986..429e87b 100644
--- a/libguile/_scm.h
+++ b/libguile/_scm.h
@@ -79,20 +79,6 @@
 #include "libguile/modules.h"
 #include "libguile/inline.h"
-/* SCM_SYSCALL retries system calls that have been interrupted (EINTR).
-   However this can be avoided if the operating system can restart
-   system calls automatically.  We assume this is the case if
-   sigaction is available and SA_RESTART is defined; they will be used
-   when installing signal handlers.
-   */
-#if ! SCM_USE_PTHREAD_THREADS /* However, don't assume SA_RESTART 
-                                 works with pthreads... */
-#define SCM_SYSCALL(line) line
 #ifndef SCM_SYSCALL
 #ifdef vms
 # ifndef __GNUC__
diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index 258710e..f4772b7 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -306,10 +306,8 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
            "a scheme procedure has been specified, that procedure will run\n"
            "in the given @var{thread}.   When no thread has been given, the\n"
            "thread that made this call to @code{sigaction} is used.\n"
-           "Flags can "
-           "optionally be specified for the new handler (@code{SA_RESTART} 
-           "always be added if it's available and the system is using 
-           "system calls.)  The return value is a pair with information about 
+           "Flags can optionally be specified for the new handler.\n"
+           "The return value is a pair with information about the\n"
            "old handler as described above.\n\n"
            "This interface does not provide access to the \"signal 
            "facility.  Maybe this is not needed, since the thread support 
@@ -333,14 +331,7 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
   csig = scm_to_signed_integer (signum, 0, NSIG-1);
 #if defined(HAVE_SIGACTION)
-  /* don't allow SA_RESTART to be omitted if HAVE_RESTARTABLE_SYSCALLS
-     is defined, since libguile would be likely to produce spurious
-     EINTR errors.  */
-  action.sa_flags = SA_RESTART;
   action.sa_flags = 0;
   if (!SCM_UNBNDP (flags))
     action.sa_flags |= scm_to_int (flags);
   sigemptyset (&action.sa_mask);
@@ -713,29 +704,6 @@ scm_init_scmsigs ()
       orig_handlers[i] = SIG_ERR;
-      /* If HAVE_RESTARTABLE_SYSCALLS is defined, it's important that
-        signals really are restartable.  don't rely on the same
-        run-time that configure got: reset the default for every signal.
-      */
-      siginterrupt (i, 0);
-#elif defined(SA_RESTART)
-      {
-       struct sigaction action;
-       sigaction (i, NULL, &action);
-       if (!(action.sa_flags & SA_RESTART))
-         {
-           action.sa_flags |= SA_RESTART;
-           sigaction (i, &action, NULL);
-         }
-      }
-      /* if neither siginterrupt nor SA_RESTART are available we may
-        as well assume that signals are always restartable.  */
   scm_c_define ("NSIG", scm_from_long (NSIG));

GNU Guile

reply via email to

[Prev in Thread] Current Thread [Next in Thread]