delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/03/15/16:20:11

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 15 Mar 2002 22:19:40 +0100
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin <cygwin AT cygwin DOT com>
Subject: Re: Latest poll() hangs again (was Re: poll() bugs and patch)
Message-ID: <20020315221940.J29574@cygbert.vinschen.de>
Mail-Followup-To: cygwin <cygwin AT cygwin DOT com>
References: <20020313181423 DOT C29574 AT cygbert DOT vinschen DOT de> <LOBBKDBPKEGJJFKNFHKBCEPEGJAA DOT boriss AT web DOT de> <20020314131554 DOT I29574 AT cygbert DOT vinschen DOT de> <20020315200120 DOT GA2484 AT tishler DOT net>
Mime-Version: 1.0
In-Reply-To: <20020315200120.GA2484@tishler.net>
User-Agent: Mutt/1.3.22.1i

On Fri, Mar 15, 2002 at 03:01:21PM -0500, Jason Tishler wrote:
> On Thu, Mar 14, 2002 at 01:15:54PM +0100, Corinna Vinschen wrote:
> > Thanks for the patch.  I've applied it with some changes.
> 
> I was concerned when I first saw this patch.  Unfortunately, I just
> tried it and my concerns were realized.
> 
> This patch causes poll() to hang again when only an invalid file
> descriptor is specified.  See the following for a test case:
> 
>     http://sources.redhat.com/ml/cygwin-patches/2001-q3/msg00109.html
> 
> Please revert this patch or modify it so that poll() does not hang.

I don't think reverting is the way to go.  One of the problems
was that cygwin_select isn't called at all if all fd's are
invalid, even if a timeout value is given.  Boris patch fixed
that.  Unfortunately the problem you're describing is a border
case which wasn't handled correctly by your patch as well, AFAICS.
The correct solution would be to return immediately (aka
cygwin_select isn't called) only if all fd's are invalid AND
the timeout value is set to INFINITE (-1).

Unfortunately SUSv2 doesn't handle that special case.  That's
a pity.

However, we could revert to handle invalid_fds again and then call
cygwin_select only if timeout != -1.

Comments?  Boris?  Jason?  Anybody else?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019