all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] woraround for buggy HPUX 11.00 select() causing emacs 21.2 to hang
@ 2002-08-29 17:30 Joe Buehler
  0 siblings, 0 replies; only message in thread
From: Joe Buehler @ 2002-08-29 17:30 UTC (permalink / raw)


The attached patch works around a select() bug in HPUX 11.0.

I don't know whether this is a general problem in HPUX 11, but I
did notice on the HP support site that there is a patch for
HPUX 11.11 for this problem (it's how I fugured out what was
wrong).

Essentially, the select() call is failing to time out when signals
are set up to use SA_RESTART.  The problem happens when a periodic
signal (e.g. SIGALRM) never gives a chance for select() to time
out -- the restart causes select() to start its timeout counter
all over again.

To duplicate the problem, edit a file in a read-only directory
and attempt to save the file, or M-x man on some man page, then
hit return on a word in the man page that has no man page.  Emacs
will hang in both cases.

I don't know whether it is a good idea to turn off SA_RESTART
for HPUX 11 in general -- I am just submitting this in case someone
else runs into this.

Joe Buehler

--- src/s/hpux11.h	Wed Oct 31 12:32:45 2001
+++ src/s/hpux11.h	Wed Aug 28 16:11:38 2002
@@ -6,3 +6,6 @@
  #undef POSIX_SIGNALS
  #endif
  #define POSIX_SIGNALS 1
+
+/* my version of HPUX 11.00 has a broken select() -- it does not time out properly */
+#define HPUX_SELECT_BUG 1
--- src/sysdep.c	Mon Nov 19 09:48:11 2001
+++ src/sysdep.c	Thu Aug 29 12:47:13 2002
@@ -2803,7 +2803,7 @@
    struct sigaction new_action, old_action;
    sigemptyset (&new_action.sa_mask);
    new_action.sa_handler = action;
-#ifdef SA_RESTART
+#if defined(SA_RESTART) && !defined(HPUX_SELECT_BUG)
    /* Emacs mostly works better with restartable system services. If this
     * flag exists, we probably want to turn it on here.
     */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-29 17:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-29 17:30 [PATCH] woraround for buggy HPUX 11.00 select() causing emacs 21.2 to hang Joe Buehler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.