From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: MS-Windows build broken in Fmake_network_process Date: Fri, 26 Mar 2010 16:48:18 +0100 Message-ID: References: <83634jglab.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269636396 732 80.91.229.12 (26 Mar 2010 20:46:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 26 Mar 2010 20:46:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 26 21:46:31 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 1NvGPp-0007yU-A3 for ged-emacs-devel@m.gmane.org; Fri, 26 Mar 2010 21:46:01 +0100 Original-Received: from localhost ([127.0.0.1]:52963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvGGC-0002Rn-6k for ged-emacs-devel@m.gmane.org; Fri, 26 Mar 2010 16:36:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvC7P-0006Ng-DW for emacs-devel@gnu.org; Fri, 26 Mar 2010 12:10:43 -0400 Original-Received: from [140.186.70.92] (port=42391 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvC7N-0006L9-UO for emacs-devel@gnu.org; Fri, 26 Mar 2010 12:10:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvC7K-0007s4-By for emacs-devel@gnu.org; Fri, 26 Mar 2010 12:10:41 -0400 Original-Received: from dial-181203.pool.broadband44.net ([212.46.181.203]:58807 helo=ix) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvC7H-0007rE-6c; Fri, 26 Mar 2010 12:10:35 -0400 Original-Received: from helmut by ix with local (Exim 4.69) (envelope-from ) id 1NvBli-0000zD-S8; Fri, 26 Mar 2010 16:48:18 +0100 In-Reply-To: <83634jglab.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Mar 2010 18:22:36 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Fri, 26 Mar 2010 16:06:54 -0400 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:122718 Archived-At: * Eli Zaretskii [2010-03-26 16:22+0100] writes: > This change: > > revno: 99750 > author: Helmut Eller > committer: YAMAMOTO Mitsuharu > branch nick: trunk > timestamp: Thu 2010-03-25 17:48:52 +0900 > message: > Call `select' for interrupted `connect' rather than creating new socket (Bug#5173). > > breaks the MS-Windows build: > > The compiler emits a warning, and the linker errors out: > > gcc -I. -c -gdwarf-2 -g3 -mtune=pentium4 -O2 -Demacs=1 -DHAVE_CONFIG_H -I../nt/inc -DHAVE_NTGUI=1 -DUSE_CRT_DLL=1 -o oo-spd/i386/process.o process.c > process.c: In function `Fmake_network_process': > process.c:3663: warning: passing arg 4 of `getsockopt' from incompatible pointer type > > oo-spd/i386/temacs1.a(process.o)(.text+0x3297): In function `Fmake_network_process': > D:\gnu\bzr\emacs\trunk\src/process.c:3663: undefined reference to `getsockopt@20' > > The compiler warning is because the prototype on Windows is: > > int getsockopt(SOCKET, int, int, char*, int*); > > The linker error is because we would need to link against yet another > library to get this function. But I don't think we should do that. > I'm actually bewildered why this code: > > int len = sizeof xerrno; > eassert (FD_ISSET (s, &fdset)); > if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1) > report_file_error ("getsockopt failed", Qnil); > > was used unconditionally when a very similar code in > wait_reading_process_output is clearly marked with a comment saying > not to use it except on GNU/Linux: > > #ifdef GNU_LINUX > /* getsockopt(,,SO_ERROR,,) is said to hang on some systems. > So only use it on systems where it is known to work. */ > { > int xlen = sizeof(xerrno); > if (getsockopt(channel, SOL_SOCKET, SO_ERROR, &xerrno, &xlen)) > xerrno = errno; > } > #else > > Would you please provide an alternative code (similar to what the > #else branch does in wait_reading_process_output) that will not use > getsockopt? getsockopt is not Linux specific; it's pretty much part of the BSD socket API and is available on Windows too. Why don't you just link it in which would simplify wait_reading_process_output too? Why do the Unix ports have to pay the price for the Window port? Helmut