[ntpsec commit] Rewrite the signaled-IO code to be POSIX-conformant.

Eric S. Raymond esr at ntpsec.org
Tue Sep 29 20:44:29 UTC 2015


Module:    ntpsec
Branch:    master
Commit:    e7ce162a7ef336ca6a2b4cf5a0cf8bb973240681
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=e7ce162a7ef336ca6a2b4cf5a0cf8bb973240681

Author:    Eric S. Raymond <esr at thyrsus.com>
Date:      Tue Sep 29 16:36:38 2015 -0400

Rewrite the signaled-IO code to be POSIX-conformant.

Contrary to what some comments in the configure.ac for NTP classic implied,
this would probably work under Linux and *BSD.

I have not enabled this code yet because asynchronous I/O is
notoriously difficult to debug and we don't need that complication
working towards a first release.  The main purpose of this rewrite
was to throw out a lot of dubious backwards-compatibility cruft.

Later, if we find we need the performance boost, we can enable and test this.
If we don't need the performance the path of wisdom would be to throw it out.

---

 include/iosignal.h   |  37 ++-----
 include/ntpd.h       |   2 +-
 libntp/iosignal.c    | 278 +++++++++------------------------------------------
 libntp/recvbuff.c    |   2 +-
 libntp/systime.c     |   2 +-
 libntp/work_thread.c |   4 +-
 ntpd/ntp_io.c        |  22 ++--
 pylib/configure.py   |  27 ++---
 8 files changed, 74 insertions(+), 300 deletions(-)

diff --git a/include/iosignal.h b/include/iosignal.h
index 97233ee..1c00022 100644
--- a/include/iosignal.h
+++ b/include/iosignal.h
@@ -3,39 +3,13 @@
 
 #include "ntp_refclock.h"
 
- /*
- * Some systems (MOST) define SIGPOLL == SIGIO, others SIGIO == SIGPOLL, and
- * a few have separate SIGIO and SIGPOLL signals.  This code checks for the
- * SIGIO == SIGPOLL case at compile time.
- * Do not define USE_SIGPOLL or USE_SIGIO.
- * these are interal only to iosignal.c and ntpd/work_fork.c!
+/* 
+ * type of input handler function
+ * only shared between iosignal.c and ntp_io.c
  */
-#if defined(USE_SIGPOLL)
-# undef USE_SIGPOLL
-#endif
-#if defined(USE_SIGIO)
-# undef USE_SIGIO
-#endif
-
-/* type of input handler function - only shared between iosignal.c and ntp_io.c */
 typedef void (input_handler_t)(l_fp *);
 
-#if defined(HAVE_SIGNALED_IO)
-# if defined(USE_TTY_SIGPOLL) || defined(USE_UDP_SIGPOLL)
-#  define USE_SIGPOLL
-# endif
-
-# if !defined(USE_TTY_SIGPOLL) || !defined(USE_UDP_SIGPOLL)
-#  define USE_SIGIO
-# endif
-
-# if defined(USE_SIGIO) && defined(USE_SIGPOLL)
-#  if SIGIO == SIGPOLL
-#   define USE_SIGIO
-#   undef USE_SIGPOLL
-#  endif	/* SIGIO == SIGPOLL */
-# endif		/* USE_SIGIO && USE_SIGPOLL */
-
+#if defined(ENABLE_SIGNALED_IO)
 #define	USING_SIGIO()	using_sigio
 
 extern bool		using_sigio;
@@ -45,11 +19,12 @@ extern void		unblock_sigio	(void);
 extern bool		init_clock_sig	(struct refclockio *);
 extern void		init_socket_sig	(int);
 extern void		set_signal	(input_handler_t *);
+extern void		wait_for_signal (void);
 
 # define BLOCKIO()	block_sigio()
 # define UNBLOCKIO()	unblock_sigio()
 
-#else	/* !HAVE_SIGNALED_IO follows */
+#else	/* !ENABLE_SIGNALED_IO follows */
 # define BLOCKIO()	do {} while (0)
 # define UNBLOCKIO()	do {} while (0)
 # define USING_SIGIO()	false
diff --git a/include/ntpd.h b/include/ntpd.h
index 95e10f5..3ab6dd6 100644
--- a/include/ntpd.h
+++ b/include/ntpd.h
@@ -130,7 +130,7 @@ extern	void	sendpkt 	(sockaddr_u *, struct interface *, int, struct pkt *, int);
 #ifdef DEBUG
 extern	void	collect_timing  (struct recvbuf *, const char *, int, l_fp *);
 #endif
-#ifdef HAVE_SIGNALED_IO
+#ifdef ENABLE_SIGNALED_IO
 extern	void	wait_for_signal		(void);
 extern	void	unblock_io_and_alarm	(void);
 extern	void	block_io_and_alarm	(void);
diff --git a/libntp/iosignal.c b/libntp/iosignal.c
index 59fbaa5..0da2d8b 100644
--- a/libntp/iosignal.c
+++ b/libntp/iosignal.c
@@ -16,15 +16,7 @@
 
 #include <stdio.h>
 #include <signal.h>
-#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
-#endif /* HAVE_SYS_PARAM_H */
-#ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#endif
-
-#include <arpa/inet.h>
-#include <net/if.h>
+#include <fcntl.h>
 
 #include "ntp_machine.h"
 #include "ntpd.h"
@@ -32,11 +24,11 @@
 #include "ntp_stdlib.h"
 #include "iosignal.h"
 
-#if defined(HAVE_SIGNALED_IO)
+#if defined(ENABLE_SIGNALED_IO)
 static void sigio_handler	(int);
 
 /* consistency safegurad to catch BLOCK/UNBLOCK oversights */
-static int sigio_block_count = 0;
+static volatile int sigio_block_count = 0;
 
 /* main inputhandler to be called on SIGIO */
 static input_handler_t *input_handler_callback = NULL;
@@ -51,10 +43,10 @@ static input_handler_t *input_handler_callback = NULL;
  * if the handler executes a piece of code that is normally
  * bracketed by BLOCKIO()/UNBLOCKIO() calls.
  */
-static int sigio_handler_active = 0;	/* semaphore, not bool */
+static volatile int sigio_handler_active = 0;	/* semaphore, not bool */
 
 /*
- * SIGPOLL and SIGIO ROUTINES.
+ * SIGIO ROUTINES.
  */
 
 
@@ -67,121 +59,25 @@ init_clock_sig(
 	struct refclockio *rio
 	)
 {
-# ifdef USE_TTY_SIGPOLL
-	{
-		/* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */
-		if (ioctl(rio->fd, I_SETSIG, S_INPUT) < 0)
-		{
-			msyslog(LOG_ERR,
-				"init_clock_sig: ioctl(I_SETSIG, S_INPUT) failed: %m");
-			return true;
-		}
-		return false;
-	}
-# else
-	/*
-	 * Special cases first!
-	 */
-	/* Was: defined(SYS_HPUX) */
-#  if defined(FIOSSAIOOWN) && defined(FIOSNBIO) && defined(FIOSSAIOSTAT)
-#define CLOCK_DONE
-	{
-		int pgrp, on = 1;
-
-		/* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */
-		pgrp = getpid();
-		if (ioctl(rio->fd, FIOSSAIOOWN, (char *)&pgrp) == -1)
-		{
-			msyslog(LOG_ERR, "ioctl(FIOSSAIOOWN) fails for clock I/O: %m - EXITING");
-			exit(1);
-			/*NOTREACHED*/
-		}
-
-		/*
-		 * set non-blocking, async I/O on the descriptor
-		 */
-		if (ioctl(rio->fd, FIOSNBIO, (char *)&on) == -1)
-		{
-			msyslog(LOG_ERR, "ioctl(FIOSNBIO) fails for clock I/O: %m - EXITING");
-			exit(1);
-			/*NOTREACHED*/
-		}
-
-		if (ioctl(rio->fd, FIOSSAIOSTAT, (char *)&on) == -1)
-		{
-			msyslog(LOG_ERR, "ioctl(FIOSSAIOSTAT) fails for clock I/O: %m - EXITING");
-			exit(1);
-			/*NOTREACHED*/
-		}
-		return false;
-	}
-#  endif /* SYS_HPUX: FIOSSAIOOWN && FIOSNBIO && FIOSSAIOSTAT */
-	/* Was: defined(SYS_AIX) && !defined(_BSD) */
-#  if !defined(_BSD) && defined(_AIX) && defined(FIOASYNC) && defined(FIOSETOWN)
 	/*
-	 * SYSV compatibility mode under AIX.
+	 * SuSv2 way to set up asynchronous tty  I/O - process is sent SIGIO when
+	 * I/O is possible on the fd.  Confusingly, according to the srabdard,
+	 * it would be SIGURG on a socket. But real implementations seem to
+	 * use the same signal number for these.
 	 */
-#define CLOCK_DONE
+	if (fcntl(rio->fd, F_SETOWN, getpid()) == -1)
 	{
-		int pgrp, on = 1;
-
-		/* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */
-		if (ioctl(rio->fd, FIOASYNC, (char *)&on) == -1)
-		{
-			msyslog(LOG_ERR, "ioctl(FIOASYNC) fails for clock I/O: %m");
-			return true;
-		}
-		pgrp = -getpid();
-		if (ioctl(rio->fd, FIOSETOWN, (char*)&pgrp) == -1)
-		{
-			msyslog(LOG_ERR, "ioctl(FIOSETOWN) fails for clock I/O: %m");
-			return true;
-		}
-
-		if (fcntl(rio->fd, F_SETFL, O_NONBLOCK|O_ASYNC) < 0)
-		{
-			msyslog(LOG_ERR, "fcntl(O_NONBLOCK|O_ASYNC) fails for clock I/O: %m");
-			return true;
-		}
-		return false;
+		msyslog(LOG_ERR, "fcntl(F_SETOWN) fails for clock I/O: %m");
+		return true;
 	}
-#  endif /* AIX && !BSD: !_BSD && FIOASYNC && FIOSETOWN */
-#  ifndef  CLOCK_DONE
+
+	if (fcntl(rio->fd, F_SETFL, O_NONBLOCK|O_ASYNC) < 0)
 	{
-		/* DO NOT ATTEMPT TO MAKE CLOCK-FD A CTTY: not portable, unreliable */
-#	if defined(TIOCSCTTY) && defined(USE_FSETOWNCTTY)
-		/*
-		 * there are, however, always exceptions to the rules
-		 * one is, that OSF accepts SETOWN on TTY fd's only, iff they are
-		 * CTTYs. SunOS and HPUX do not semm to have this restriction.
-		 * another question is: how can you do multiple SIGIO from several
-		 * ttys (as they all should be CTTYs), wondering...
-		 *
-		 * kd 95-07-16
-		 */
-		if (ioctl(rio->fd, TIOCSCTTY, 0) == -1)
-		{
-			msyslog(LOG_ERR, "ioctl(TIOCSCTTY, 0) fails for clock I/O: %m");
-			return true;
-		}
-#	endif /* TIOCSCTTY && USE_FSETOWNCTTY */
-
-		if (fcntl(rio->fd, F_SETOWN, getpid()) == -1)
-		{
-			msyslog(LOG_ERR, "fcntl(F_SETOWN) fails for clock I/O: %m");
-			return true;
-		}
-
-		if (fcntl(rio->fd, F_SETFL, O_NONBLOCK|O_ASYNC) < 0)
-		{
-			msyslog(LOG_ERR,
-				"fcntl(O_NONBLOCK|O_ASYNC) fails for clock I/O: %m");
-			return true;
-		}
-		return false;
+		msyslog(LOG_ERR,
+			"fcntl(O_NONBLOCK|O_ASYNC) fails for clock I/O: %m");
+		return true;
 	}
-#  endif /* CLOCK_DONE */
-# endif /* !USE_TTY_SIGPOLL  */
+	return false;
 }
 
 
@@ -191,82 +87,35 @@ init_socket_sig(
 	int fd
 	)
 {
-# ifdef USE_UDP_SIGPOLL
+	int flags;
+
+	/*
+	 * SuSv2 way to set up asynchronous socket I/O - process is
+	 * sent SIGURG when I/O is possible on the fd.  Confusingly,
+	 * it would be SIGIO on a tty.  But in the real world it
+	 * appears that SIGIO == SIGURG.  Code later in this fimction
+	 * assumes this.
+	 */
+	if ((flags = fcntl(fd, F_GETFL, 0)) == -1)
+	{
+		msyslog(LOG_ERR, "fcntl(F_GETFL) fails: %m - EXITING");
+		exit(1);
+		/*NOTREACHED*/
+	}
+	if (fcntl(fd, F_SETFL, flags|O_ASYNC) < 0)
 	{
-		if (ioctl(fd, I_SETSIG, S_INPUT) < 0)
-		{
-			msyslog(LOG_ERR,
-				"init_socket_sig: ioctl(I_SETSIG, S_INPUT) failed: %m - EXITING");
-			exit(1);
-		}
+		msyslog(LOG_ERR, "fcntl(...|O_ASYNC) fails: %m - EXITING");
+		exit(1);
+		/*NOTREACHED*/
 	}
-# else /* USE_UDP_SIGPOLL */
+
+
+	if (fcntl(fd, F_SETOWN, getpid()) == -1)
 	{
-		int pgrp;
-# ifdef FIOASYNC
-		int on = 1;
-# endif
-
-#  if defined(FIOASYNC)
-		if (ioctl(fd, FIOASYNC, (char *)&on) == -1)
-		{
-			msyslog(LOG_ERR, "ioctl(FIOASYNC) fails: %m - EXITING");
-			exit(1);
-			/*NOTREACHED*/
-		}
-#  elif defined(O_ASYNC)
-		{
-			int flags;
-
-			if ((flags = fcntl(fd, F_GETFL, 0)) == -1)
-			{
-				msyslog(LOG_ERR, "fcntl(F_GETFL) fails: %m - EXITING");
-				exit(1);
-				/*NOTREACHED*/
-			}
-			if (fcntl(fd, F_SETFL, flags|O_ASYNC) < 0)
-			{
-				msyslog(LOG_ERR, "fcntl(...|O_ASYNC) fails: %m - EXITING");
-				exit(1);
-				/*NOTREACHED*/
-			}
-		}
-#  else
-#	include "Bletch: Need asynchronous I/O!"
-#  endif
-
-#  ifdef UDP_BACKWARDS_SETOWN
-		pgrp = -getpid();
-#  else
-		pgrp = getpid();
-#  endif
-
-#  if defined(SIOCSPGRP)
-		if (ioctl(fd, SIOCSPGRP, (char *)&pgrp) == -1)
-		{
-			msyslog(LOG_ERR, "ioctl(SIOCSPGRP) fails: %m - EXITING");
-			exit(1);
-			/*NOTREACHED*/
-		}
-#  elif defined(FIOSETOWN)
-		if (ioctl(fd, FIOSETOWN, (char*)&pgrp) == -1)
-		{
-			msyslog(LOG_ERR, "ioctl(FIOSETOWN) fails: %m - EXITING");
-			exit(1);
-			/*NOTREACHED*/
-		}
-#  elif defined(F_SETOWN)
-		if (fcntl(fd, F_SETOWN, pgrp) == -1)
-		{
-			msyslog(LOG_ERR, "fcntl(F_SETOWN) fails: %m - EXITING");
-			exit(1);
-			/*NOTREACHED*/
-		}
-#  else
-#	include "Bletch: Need to set process(group) to receive SIG(IO|POLL)"
-#  endif
+		msyslog(LOG_ERR, "fcntl(F_SETOWN) fails: %m - EXITING");
+		exit(1);
+		/*NOTREACHED*/
 	}
-# endif /* USE_UDP_SIGPOLL */
 }
 
 static void
@@ -304,12 +153,7 @@ set_signal(input_handler_t *input)
 	input_handler_callback = input;
 
 	using_sigio = true;
-#  ifdef USE_SIGIO
 	(void) signal_no_reset(SIGIO, sigio_handler);
-# endif
-#  ifdef USE_SIGPOLL
-	(void) signal_no_reset(SIGPOLL, sigio_handler);
-# endif
 }
 
 void
@@ -319,14 +163,8 @@ block_io_and_alarm(void)
 
 	if (sigemptyset(&set))
 	    msyslog(LOG_ERR, "block_io_and_alarm: sigemptyset() failed: %m");
-#  if defined(USE_SIGIO)
 	if (sigaddset(&set, SIGIO))
 	    msyslog(LOG_ERR, "block_io_and_alarm: sigaddset(SIGIO) failed: %m");
-#  endif
-#  if defined(USE_SIGPOLL)
-	if (sigaddset(&set, SIGPOLL))
-	    msyslog(LOG_ERR, "block_io_and_alarm: sigaddset(SIGPOLL) failed: %m");
-#  endif
 	if (sigaddset(&set, SIGALRM))
 	    msyslog(LOG_ERR, "block_io_and_alarm: sigaddset(SIGALRM) failed: %m");
 
@@ -337,7 +175,8 @@ block_io_and_alarm(void)
 void
 block_sigio(void)
 {
-	if ( sigio_handler_active == 0 )  /* not called from within signal handler */
+	/* not called from within signal handler */
+	if ( sigio_handler_active == 0 )
 	{
 		sigset_t set;
 
@@ -349,15 +188,8 @@ block_sigio(void)
 
 		if (sigemptyset(&set))
 		    msyslog(LOG_ERR, "block_sigio: sigemptyset() failed: %m");
-#	if defined(USE_SIGIO)
 		if (sigaddset(&set, SIGIO))
 		    msyslog(LOG_ERR, "block_sigio: sigaddset(SIGIO) failed: %m");
-#	endif
-#	if defined(USE_SIGPOLL)
-		if (sigaddset(&set, SIGPOLL))
-		    msyslog(LOG_ERR, "block_sigio: sigaddset(SIGPOLL) failed: %m");
-#	endif
-
 		if (sigprocmask(SIG_BLOCK, &set, NULL))
 		    msyslog(LOG_ERR, "block_sigio: sigprocmask() failed: %m");
 	}
@@ -371,14 +203,8 @@ unblock_io_and_alarm(void)
 	if (sigemptyset(&unset))
 	    msyslog(LOG_ERR, "unblock_io_and_alarm: sigemptyset() failed: %m");
 
-#  if defined(USE_SIGIO)
 	if (sigaddset(&unset, SIGIO))
 	    msyslog(LOG_ERR, "unblock_io_and_alarm: sigaddset(SIGIO) failed: %m");
-#  endif
-#  if defined(USE_SIGPOLL)
-	if (sigaddset(&unset, SIGPOLL))
-	    msyslog(LOG_ERR, "unblock_io_and_alarm: sigaddset(SIGPOLL) failed: %m");
-#  endif
 	if (sigaddset(&unset, SIGALRM))
 	    msyslog(LOG_ERR, "unblock_io_and_alarm: sigaddset(SIGALRM) failed: %m");
 
@@ -402,15 +228,8 @@ unblock_sigio(void)
 		if (sigemptyset(&unset))
 		    msyslog(LOG_ERR, "unblock_sigio: sigemptyset() failed: %m");
 
-#	if defined(USE_SIGIO)
 		if (sigaddset(&unset, SIGIO))
 		    msyslog(LOG_ERR, "unblock_sigio: sigaddset(SIGIO) failed: %m");
-#	endif
-#	if defined(USE_SIGPOLL)
-		if (sigaddset(&unset, SIGPOLL))
-		    msyslog(LOG_ERR, "unblock_sigio: sigaddset(SIGPOLL) failed: %m");
-#	endif
-
 		if (sigprocmask(SIG_UNBLOCK, &unset, NULL))
 		    msyslog(LOG_ERR, "unblock_sigio: sigprocmask() failed: %m");
 	}
@@ -424,14 +243,9 @@ wait_for_signal(void)
 	if (sigprocmask(SIG_UNBLOCK, NULL, &old))
 	    msyslog(LOG_ERR, "wait_for_signal: sigprocmask() failed: %m");
 
-#  if defined(USE_SIGIO)
 	if (sigdelset(&old, SIGIO))
 	    msyslog(LOG_ERR, "wait_for_signal: sigdelset(SIGIO) failed: %m");
-#  endif
-#  if defined(USE_SIGPOLL)
-	if (sigdelset(&old, SIGPOLL))
-	    msyslog(LOG_ERR, "wait_for_signal: sigdelset(SIGPOLL) failed: %m");
-#  endif
+
 	if (sigdelset(&old, SIGALRM))
 	    msyslog(LOG_ERR, "wait_for_signal: sigdelset(SIGALRM) failed: %m");
 
diff --git a/libntp/recvbuff.c b/libntp/recvbuff.c
index f43ff9f..3885141 100644
--- a/libntp/recvbuff.c
+++ b/libntp/recvbuff.c
@@ -227,7 +227,7 @@ get_full_recv_buffer(void)
 
 	LOCK();
 	
-#ifdef HAVE_SIGNALED_IO
+#ifdef ENABLE_SIGNALED_IO
 	/*
 	 * make sure there are free buffers when we
 	 * wander off to do lengthy packet processing with
diff --git a/libntp/systime.c b/libntp/systime.c
index 9466082..78f6b75 100644
--- a/libntp/systime.c
+++ b/libntp/systime.c
@@ -86,7 +86,7 @@ static bool systime_init_done;
 # define DONE_SYSTIME_INIT()	do {} while (false)
 #endif
 
-#ifdef HAVE_SIGNALED_IO
+#ifdef ENABLE_SIGNALED_IO
 bool using_sigio;
 #endif
 
diff --git a/libntp/work_thread.c b/libntp/work_thread.c
index 7a36d72..63dc211 100644
--- a/libntp/work_thread.c
+++ b/libntp/work_thread.c
@@ -486,14 +486,14 @@ block_thread_signals(
 	sigset_t	block;
 
 	sigemptyset(&block);
-# ifdef HAVE_SIGNALED_IO
+# ifdef ENABLE_SIGNALED_IO
 #  ifdef SIGIO
 	sigaddset(&block, SIGIO);
 #  endif
 #  ifdef SIGPOLL
 	sigaddset(&block, SIGPOLL);
 #  endif
-# endif	/* HAVE_SIGNALED_IO */
+# endif	/* ENABLE_SIGNALED_IO */
 	sigaddset(&block, SIGALRM);
 	sigaddset(&block, MOREDEBUGSIG);
 	sigaddset(&block, LESSDEBUGSIG);
diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c
index a05b4ee..0b725ea 100644
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -449,7 +449,7 @@ init_io(void)
 	init_io_completion_port();
 #endif
 
-#if defined(HAVE_SIGNALED_IO)
+#if defined(ENABLE_SIGNALED_IO)
 	(void) set_signal(input_handler);
 #endif
 }
@@ -464,9 +464,9 @@ ntpd_addremove_io_fd(
 {
 	UNUSED_ARG(is_pipe);
 
-#ifdef HAVE_SIGNALED_IO
+#ifdef ENABLE_SIGNALED_IO
 	init_socket_sig(fd);
-#endif /* not HAVE_SIGNALED_IO */
+#endif /* not ENABLE_SIGNALED_IO */
 
 	maintain_activefds(fd, remove_it);
 }
@@ -3069,9 +3069,9 @@ open_socket(
 
 	make_socket_nonblocking(fd);
 
-#ifdef HAVE_SIGNALED_IO
+#ifdef ENABLE_SIGNALED_IO
 	init_socket_sig(fd);
-#endif /* not HAVE_SIGNALED_IO */
+#endif /* not ENABLE_SIGNALED_IO */
 
 	add_fd_to_list(fd, FD_TYPE_SOCKET);
 
@@ -3556,7 +3556,7 @@ read_network_packet(
 void
 io_handler(void)
 {
-#  ifndef HAVE_SIGNALED_IO
+#  ifndef ENABLE_SIGNALED_IO
 	fd_set rdfdes;
 	int nfound;
 
@@ -3587,9 +3587,9 @@ io_handler(void)
 		DPRINTF(1, ("select() returned %d: %m\n", nfound));
 	}
 #   endif /* DEBUG */
-#  else /* HAVE_SIGNALED_IO */
+#  else /* ENABLE_SIGNALED_IO */
 	wait_for_signal();
-#  endif /* HAVE_SIGNALED_IO */
+#  endif /* ENABLE_SIGNALED_IO */
 }
 
 /*
@@ -4293,7 +4293,7 @@ io_addclock(
 	 */
 	rio->active = true;
 
-# ifdef HAVE_SIGNALED_IO
+# ifdef ENABLE_SIGNALED_IO
 	if (init_clock_sig(rio)) {
 		UNBLOCKIO();
 		return false;
@@ -4732,9 +4732,9 @@ init_async_notifications()
 	}
 #endif
 	make_socket_nonblocking(fd);
-#if defined(HAVE_SIGNALED_IO)
+#if defined(ENABLE_SIGNALED_IO)
 	init_socket_sig(fd);
-#endif /* HAVE_SIGNALED_IO */
+#endif /* ENABLE_SIGNALED_IO */
 
 	reader = new_asyncio_reader();
 
diff --git a/pylib/configure.py b/pylib/configure.py
index 1fb9846..909d93b 100644
--- a/pylib/configure.py
+++ b/pylib/configure.py
@@ -379,27 +379,12 @@ int main() { return 0; }
 	# Shouldn't be an issue as 8.x shipped in January 1991!
 	# ctx.define("NEED_RCVBUF_SLOP", 1)
 
-	# Some Unixes allow use of signalled I/O for TCP and UDP I/O.
-	# The following systems, notably including Linux and FreeBSD,
-	# do *not* allow this:
-	#
-	# alpha*-dec-osf4*|alpha*-dec-osf5*)
-	# *-convex-*)
-	# *-dec-*)
-	# *-pc-cygwin*)
-	# *-sni-sysv*)
-	# *-stratus-vos)
-	# *-univel-sysv*)
-	# *-*-irix6*)
-	# *-*-freebsd*)
-	# *-*-*linux*)
-	# *-*-unicosmp*)
-	# *-*-kfreebsd*)
-	# m68k-*-mint*)
-	#
-	# Until we can test for system type better, don't enable this/
-	#
-	# ctx.define("HAVE_SIGNALED_IO", 1)
+	# It should be possible to use asynchrpnous I/O with notification
+	# by SIGIO on any Unix conformant to POSIX.1-2001. But she code to
+	# do this is untested and there are historical reasons to suspect
+	# it might not work reliably on all platforms.  Enable cautiously
+	# and test carefully.
+	# ctx.define("ENABLE_SIGNALED_IO", 1)
 
         # These are required by the SHA2 code and various refclocks
         if sys.byteorder == "little":



More information about the vc mailing list