From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8594 invoked by alias); 23 Apr 2014 15:38:35 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 8583 invoked by uid 89); 23 Apr 2014 15:38:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Apr 2014 15:38:34 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id BC5408E142F; Wed, 23 Apr 2014 17:38:30 +0200 (CEST) Date: Wed, 23 Apr 2014 15:38:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Dup'd sockets lose error information Message-ID: <20140423153830.GN2339@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20140423142541.156360@gmx.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lYetfuAxy9ic4HK3" Content-Disposition: inline In-Reply-To: <20140423142541.156360@gmx.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-04/txt/msg00517.txt.bz2 --lYetfuAxy9ic4HK3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1052 On Apr 23 16:25, qq qq wrote: > The following code is a simplified app that was used to test-connect > to local ports 55000+ (none of which were actually listening) and > received false-positive "connected" results because Cygwin's dup() > for socket causes SO_ERROR to be lost. =C2=A0Since FD_SETSIZE is only 64 = on > Cygwin, the app uses dup()'s to lower the descriptors as it checks > them for completion. =C2=A0There is no such problem on Linux. > Also, strangely that Cygwin does not accept sin_addr as 0 to connect > locally (and either localhost or local host IP must be stuffed in > there, otherwise resulting in the "Cannot assign requested address" > error). This is Winsock at work. Cygwin doesn't check the AF_INET address when calling Winsock's connect, so Winsock's connect itself seems to have this issue. As for the SO_ERROR value, I have to check. Thanks for the testcase. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --lYetfuAxy9ic4HK3 Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJTV952AAoJEPU2Bp2uRE+gLpIP/Rnu0b5Wqurr33KFhVt6Rqtk qSKA5IOU4CMxiaW6EISekQwh8fXAT85QVmuTmaWMt1zTIsvcyEOMNTdY1gnUF3lV hXBKugo5OsHSzKWaHH2wOwEj+wEYMCtkygMcVwsN9o4E6TxOEQmspFnYfqTwQCEg EKULpt8//ck96oBv3vxg3Ln81bUoVysigPaxAbRtvv0gGTtWl2w+FLaLcqA+yfrA AaVdYr9R9hmqNx3rWDybNpT7CEhaAw4FJ1NmfyY695jr9rDrM4W+h3Y8QS90cM8C FrUdztu4MaJLYZh6lELu/EcMzjj0PEP63uDJIwnGF3dmu9GH10QJ7v5PNj6+7Ohe qK5LcEvuKLG8ZYEgp4iueK5Q3o+87lDHum+KUDUyuF1SW8yU285R5Kp+139hQbGD zX7kMUsbXLdB4xPOGmDv9xIYxAMsQEf9m2WhDkMe+OQxgZrgMwmeVvt+ODAcGlTK nRoIsPs9qThY8I9wBODWDvzQAwCfELPUTf+BpZ+JIt36M5vr7v43+Co4BCzM9Me5 ycCPvWjEk8+TZQDNxhRpeiQ5w9PB9aMUR/dgRU0CHB6ehu2iyQJK2sYfvvxB9v4f yU/gWyp6J1BY+7scx1Rl6ydSJq/lgRuNwdnilBBH9tkZz7DzTvgCjUiQYzDdNnqZ Esnhbl6Bzx+V4LP51sFz =B2OW -----END PGP SIGNATURE----- --lYetfuAxy9ic4HK3--