unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* BROKEN_NON_BLOCKING_CONNECT
@ 2015-03-27  9:59 Eli Zaretskii
  2015-03-27 17:58 ` BROKEN_NON_BLOCKING_CONNECT Paul Eggert
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2015-03-27  9:59 UTC (permalink / raw)
  To: emacs-devel

With commit d133cf8 on master, The MS-Windows build no longer defines
BROKEN_NON_BLOCKING_CONNECT.  Are there any other platforms that might
need it and the related SELECT_CAN_DO_WRITE_MASK and
NON_BLOCKING_CONNECT?  Or can these be deleted now?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BROKEN_NON_BLOCKING_CONNECT
  2015-03-27  9:59 BROKEN_NON_BLOCKING_CONNECT Eli Zaretskii
@ 2015-03-27 17:58 ` Paul Eggert
  2015-03-28  2:41   ` BROKEN_NON_BLOCKING_CONNECT Daniel Colascione
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Eggert @ 2015-03-27 17:58 UTC (permalink / raw)
  To: Eli Zaretskii, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]

On 03/27/2015 02:59 AM, Eli Zaretskii wrote:
> Are there any other platforms that might
> need it and the related SELECT_CAN_DO_WRITE_MASK and
> NON_BLOCKING_CONNECT?  Or can these be deleted now?
No platforms should need BROKEN_NON_BLOCKING_CONNECT or 
SELECT_CAN_DO_WRITE_MASK, so I removed them by applying the attached 
patch.  Platforms that predate POSIX.1-2001 might need 
NON_BLOCKING_CONNECT, though, since that feature wasn't standardized by 
POSIX until POSIX.1-2001, so I left that part alone for now.

This raises the topic of how far back in history Emacs should go, when 
trying to support older platforms.  Currently Emacs is quite 
conservative and relies only on POSIX.1-1988 or later.  I don't know of 
any currently-supported GNUish or Unixish platform that doesn't largely 
conform to POSIX.1-2001 or later, so as far as I know the Emacs code 
that runs only on hosts predating POSIX-2001 isn't being tested and 
quite possibly no longer works.  So it would make sense for Emacs to 
start assuming POSIX.1-2001 or later, if there's consensus for doing that.


[-- Attachment #2: 0001-Assume-BROKEN_NON_BLOCKING_CONNECT.patch --]
[-- Type: text/x-patch, Size: 3449 bytes --]

From aea8c06cc89a5db3fe0b4b9ef140d6960eaa495d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 27 Mar 2015 10:36:15 -0700
Subject: [PATCH] Assume !BROKEN_NON_BLOCKING_CONNECT

From a suggestion by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg00824.html
* process.c (NON_BLOCKING_CONNECT): Simplify by assuming that
BROKEN_NON_BLOCKING_CONNECT is not defined.
(SELECT_CAN_DO_WRITE_MASK): Remove, and assume it's now true.
---
 admin/CPP-DEFINES |  1 -
 src/ChangeLog     |  9 +++++++++
 src/process.c     | 27 +++++++++------------------
 3 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index 18423c2..796b57d 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -85,7 +85,6 @@ AMPERSAND_FULL_NAME
 BROKEN_DATAGRAM_SOCKETS
 BROKEN_FIONREAD
 BROKEN_GET_CURRENT_DIR_NAME
-BROKEN_NON_BLOCKING_CONNECT
 BROKEN_PTY_READ_AFTER_EAGAIN
 DEFAULT_SOUND_DEVICE
 DEVICE_SEP
diff --git a/src/ChangeLog b/src/ChangeLog
index 98037e8..3f9ab4f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2015-03-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Assume !BROKEN_NON_BLOCKING_CONNECT
+	From a suggestion by Eli Zaretskii in:
+	http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg00824.html
+	* process.c (NON_BLOCKING_CONNECT): Simplify by assuming that
+	BROKEN_NON_BLOCKING_CONNECT is not defined.
+	(SELECT_CAN_DO_WRITE_MASK): Remove, and assume it's now true.
+
 2015-03-27  Eli Zaretskii  <eliz@gnu.org>
 
 	* lread.c (substitute_object_recurse): For sub-char-tables, start
diff --git a/src/process.c b/src/process.c
index 3fe8644..2800fa5 100644
--- a/src/process.c
+++ b/src/process.c
@@ -195,24 +195,15 @@ static EMACS_INT process_tick;
 /* Number of events for which the user or sentinel has been notified.  */
 static EMACS_INT update_tick;
 
-/* Define NON_BLOCKING_CONNECT if we can support non-blocking connects.  */
+/* Define NON_BLOCKING_CONNECT if we can support non-blocking connects.
+   The code can be simplified by assuming NON_BLOCKING_CONNECT once
+   Emacs starts assuming POSIX 1003.1-2001 or later.  */
 
-/* Only W32 has this, it really means that select can't take write mask.  */
-#ifdef BROKEN_NON_BLOCKING_CONNECT
-#undef NON_BLOCKING_CONNECT
-enum { SELECT_CAN_DO_WRITE_MASK = false };
-#else
-enum { SELECT_CAN_DO_WRITE_MASK = true };
-#ifndef NON_BLOCKING_CONNECT
-#ifdef HAVE_SELECT
-#if defined (HAVE_GETPEERNAME) || defined (GNU_LINUX)
-#if defined (EWOULDBLOCK) || defined (EINPROGRESS)
-#define NON_BLOCKING_CONNECT
-#endif /* EWOULDBLOCK || EINPROGRESS */
-#endif /* HAVE_GETPEERNAME || GNU_LINUX */
-#endif /* HAVE_SELECT */
-#endif /* NON_BLOCKING_CONNECT */
-#endif /* BROKEN_NON_BLOCKING_CONNECT */
+#if (defined HAVE_SELECT				\
+     && (defined GNU_LINUX || defined HAVE_GETPEERNAME)	\
+     && (defined EWOULDBLOCK || defined EINPROGRESS))
+# define NON_BLOCKING_CONNECT
+#endif
 
 /* Define DATAGRAM_SOCKETS if datagrams can be used safely on
    this system.  We need to read full packets, so we need a
@@ -4606,7 +4597,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
 	    Available = input_wait_mask;
           Writeok = write_mask;
  	  check_delay = wait_proc ? 0 : process_output_delay_count;
-	  check_write = SELECT_CAN_DO_WRITE_MASK;
+	  check_write = true;
 	}
 
       /* If frame size has changed or the window is newly mapped,
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: BROKEN_NON_BLOCKING_CONNECT
  2015-03-27 17:58 ` BROKEN_NON_BLOCKING_CONNECT Paul Eggert
@ 2015-03-28  2:41   ` Daniel Colascione
  2015-03-28  6:52     ` BROKEN_NON_BLOCKING_CONNECT Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Colascione @ 2015-03-28  2:41 UTC (permalink / raw)
  To: Paul Eggert, Eli Zaretskii, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]

On 03/27/2015 10:58 AM, Paul Eggert wrote:
> On 03/27/2015 02:59 AM, Eli Zaretskii wrote:
>> Are there any other platforms that might
>> need it and the related SELECT_CAN_DO_WRITE_MASK and
>> NON_BLOCKING_CONNECT?  Or can these be deleted now?
> No platforms should need BROKEN_NON_BLOCKING_CONNECT or
> SELECT_CAN_DO_WRITE_MASK, so I removed them by applying the attached
> patch.  Platforms that predate POSIX.1-2001 might need
> NON_BLOCKING_CONNECT, though, since that feature wasn't standardized by
> POSIX until POSIX.1-2001, so I left that part alone for now.
> 
> This raises the topic of how far back in history Emacs should go, when
> trying to support older platforms.  Currently Emacs is quite
> conservative and relies only on POSIX.1-1988 or later.  I don't know of
> any currently-supported GNUish or Unixish platform that doesn't largely
> conform to POSIX.1-2001 or later, so as far as I know the Emacs code
> that runs only on hosts predating POSIX-2001 isn't being tested and
> quite possibly no longer works.  So it would make sense for Emacs to
> start assuming POSIX.1-2001 or later

It'd be nice to assume UNICODE on Windows too. Windows 95 will be 20
years old in August.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BROKEN_NON_BLOCKING_CONNECT
  2015-03-28  2:41   ` BROKEN_NON_BLOCKING_CONNECT Daniel Colascione
@ 2015-03-28  6:52     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2015-03-28  6:52 UTC (permalink / raw)
  To: Daniel Colascione; +Cc: eggert, emacs-devel

> Date: Fri, 27 Mar 2015 19:41:27 -0700
> From: Daniel Colascione <dancol@dancol.org>
> 
> It'd be nice to assume UNICODE on Windows too.

What benefits will that bring us, on newer systems?



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-28  6:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-27  9:59 BROKEN_NON_BLOCKING_CONNECT Eli Zaretskii
2015-03-27 17:58 ` BROKEN_NON_BLOCKING_CONNECT Paul Eggert
2015-03-28  2:41   ` BROKEN_NON_BLOCKING_CONNECT Daniel Colascione
2015-03-28  6:52     ` BROKEN_NON_BLOCKING_CONNECT Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).