From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MS-Windows build broken in Fmake_network_process Date: Sat, 27 Mar 2010 11:44:30 +0300 Message-ID: <83sk7mf91t.fsf@gnu.org> References: <83634jglab.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1269679486 7145 80.91.229.12 (27 Mar 2010 08:44:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 27 Mar 2010 08:44:46 +0000 (UTC) Cc: "Kim F. Storm" , emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 27 09:44:40 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NvRdH-0003mV-KU for ged-emacs-devel@m.gmane.org; Sat, 27 Mar 2010 09:44:39 +0100 Original-Received: from localhost ([127.0.0.1]:42358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvRdH-00071a-4H for ged-emacs-devel@m.gmane.org; Sat, 27 Mar 2010 04:44:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvRdA-00070j-CB for emacs-devel@gnu.org; Sat, 27 Mar 2010 04:44:32 -0400 Original-Received: from [140.186.70.92] (port=58917 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvRd8-0006zt-Jn for emacs-devel@gnu.org; Sat, 27 Mar 2010 04:44:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvRd7-0001Wv-Fc for emacs-devel@gnu.org; Sat, 27 Mar 2010 04:44:30 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:35153) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvRd7-0001Wo-8a for emacs-devel@gnu.org; Sat, 27 Mar 2010 04:44:29 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0KZX00200MP22G00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sat, 27 Mar 2010 11:44:27 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.176.135]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KZX0006XMY2FA60@a-mtaout21.012.net.il>; Sat, 27 Mar 2010 11:44:27 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:122756 Archived-At: > Date: Sat, 27 Mar 2010 09:51:56 +0900 > From: YAMAMOTO Mitsuharu > Cc: Helmut Eller , > emacs-devel@gnu.org > > Actually I was aware of the above part when I committed the change in > question. But the code above was added in 2002, and I doubted whether > it is still the case for the systems that are supported by Emacs > 24.0.50. So I didn't copy the above code for Fmake_network_process. I don't know which systems Kim Storm (who wrote that code; CC'ed) had in mind when he made it conditional on GNU/Linux. The related discussion on emacs-devel does not talk about this issue, and the preliminary version of the patch Kim posted back then does not include the conditional GNU/Linux code. But let me remind you that Windows XP, the Windows version that is still the most widely used one today, was released in 2002. > Can normal (i.e., blocking) `connect' in Windows be interrupted by a > POSIX signal counterpart? If not, then we can disable the whole added > code for Windows in the first place. As I said, I'm far from being an expert on the Windows socket library and its operation. Here's what I know about the related issues: . The Windows socket functions can only return EINTR (actually, WSAEINTR, from which we produce EINTR in Emacs's Windows source) only for the old Winsock 1.1 sockets, and only if some code calls `WSACancelBlockingCall'. Emacs does not call that function directly, and in fact it is deprecated and was removed from Winsock 2 library. . C-g does not trigger an asynchronous SIGINT on Windows like it does on Posix systems. Instead, the Emacs's Windows code has a separate input thread; when that thread sees a C-g keystroke, it triggers a special handle that is included in the set of handles on which `select' waits. `select' then returns with -1 setting errno to EINTR. This is how the Windows build interrupts prolonged ``system calls''. . Note that `select' itself is implemented (as `sys_select') in Emacs's Windows code, i.e. we don't use the Windows-supplied `select', which only works on network handles. >From this I tend to conclude that `connect' on Windows cannot be interrupted like on Posix systems, because when `connect' is called, we are not waiting in `select'. Perhaps Jason and Juanma can add their expertise to what I say above and correct me where I'm wrong.