Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3E8262B0.8070503@linuxforum.net> Date: Thu, 27 Mar 2003 10:32:16 +0800 From: David Huang User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: zh-cn, en-us, en, ja MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Failed non-blocking connect returns incorrect errno on AF_UNIX protocol References: <3E80F8E1 DOT 2000409 AT linuxforum DOT net> <20030326085220 DOT GQ23762 AT cygbert DOT vinschen DOT de> In-Reply-To: <20030326085220.GQ23762@cygbert.vinschen.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Corinna Vinschen wrote: > On Wed, Mar 26, 2003 at 08:48:33AM +0800, David Huang wrote: > >>Failed non-blocking connect returns incorrect errno on AF_UNIX protocol. >>See attached test program. >> >>On cygwin: >>$ ./afunix >>EINPROGRESS: Operation now in progress >> >>On >>Linux 2.4 (Debian 2.2) >>Linux 2.4 (Redhat 7.3) >>Sun Solaris (8): >>$ ./afunix >>ECONNREFUSED: Connection refused >> >>When i comment following code: >>// if (fcntl (fd2, F_SETFL, O_NONBLOCK) < 0) >>// printf ("Failed to set fd non-blocking"); >>The result is >>ECONNREFUSED: Connection refused >> >>It seems an old bug. >>I don't know whether it effect others address/protocol families. > > > I don't see that it's an error. On non-blocking sockets you have to > expect that connect() returns before being connected. Just because > other systems are so quick figuring out that nothing is listening on > the other side, this doesn't invalidate the EINPROGRESS response under, > well, slower conditions. Well, in my test-case, /tmp/.afunix is a dead socket, connect must return ECONNREFUSED but not EINPROGRESS, is it so? > > And, btw., SUSv3 doesn't say a word that EINPROGRESS is not a valid > response for AF_LOCAL sockets. Yea, is it a valid response for *alive* AF_LOCAL sockets? Please consider that, the test code i took from linc-1.0.1 (cleanup.c), because of that, linc-cleanup-sockets works incorrect. > Corinna > Thanks. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/