From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: BROKEN_NON_BLOCKING_CONNECT
Date: Fri, 27 Mar 2015 10:58:13 -0700 [thread overview]
Message-ID: <55159A35.70907@cs.ucla.edu> (raw)
In-Reply-To: <83384qbw1v.fsf@gnu.org>
[-- 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
next prev parent reply other threads:[~2015-03-27 17:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 9:59 BROKEN_NON_BLOCKING_CONNECT Eli Zaretskii
2015-03-27 17:58 ` Paul Eggert [this message]
2015-03-28 2:41 ` BROKEN_NON_BLOCKING_CONNECT Daniel Colascione
2015-03-28 6:52 ` BROKEN_NON_BLOCKING_CONNECT Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55159A35.70907@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.