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 Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 13 Mar 2002 15:06:21 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: poll() bugs and patch Message-ID: <20020313150621.S29574@cygbert.vinschen.de> Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.22.1i On Wed, Mar 13, 2002 at 02:30:35PM +0100, Boris Schaeling wrote: > There are several bugs in poll(): > - poll() must return 0 if no descriptor is ready and the timer expires. It > works correctly if all descriptors are non-negative. Otherwise poll() > returns the count of negative descriptors which is wrong. > - The implementation of poll() must call cygwin_select() even if all > descriptors are invalid. Currently poll() returns immediately - and ignores > any timer value. The return value is wrong again because of the bug above. > - If the timer expires revents must be 0 and must not be set to anything > else like POLLNVAL, POLLHUP or whatever. > - If cygwin_select() returns -1 revents must be 0 and must not be set to > POLLERR. Eg. a signal interrupting poll() doesn't mean an error has occured > for a TCP connection. > - If an error is pending revents must be set to POLLERR. > - The implementation of poll() has a local variable called open_fds that > isn't used. I can't see why this variable exists. > > I've attached three files: > - newpoll.cc has a new implementation of poll() which fixes the bugs. > - patch.cc is the patch. > - polltest.c is a testcase. > > I rebuilt cygwin1.dll with my poll() function so there should be no problems > when compiling. Thanks for the patch but that's not quite the way to contribute a patch. I'm missing a ChangeLog entry and, worse, we don't have a copyright assignment from you. Due to licensing issues we need the copyright assignment as described on http://cygwin.com/contrib.html before we can incorporate the patch. It's bigger than what is slipping through the cracks as "insignificant". It would really be nice if you could send us this assignment (which unfortunately has to be send via snail mail so this takes some time) and then resubmit your patch to cygwin-patches AT cygwin DOT com. Oh, could you please rename the patch file? It's somewhat irritating to have a *.cc suffix for a patch file. `poll.diff' or poll.patch' would be nice... Thanks, 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/