Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Mon, 3 Feb 2003 16:35:46 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: 1.3.19-1:poll bug.  Patch included.
Message-ID: <20030203153546.GF9587@cygbert.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20030203030307.GA16149@redhat.com> <39DA1DA2-3747-11D7-87B3-00306540AD5E@rehley.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <39DA1DA2-3747-11D7-87B3-00306540AD5E@rehley.net>
User-Agent: Mutt/1.4i

On Sun, Feb 02, 2003 at 11:15:08PM -0800, Peter Rehley wrote:
> Hello,
> 
> Just to make sure that we are both clear.  Change recvfrom so that if 
> the buffer is too small it returns the number of bytes that can be 
> written into the buffer instead of setting errno.  Also clear errno 
> since there is no error.

Reading SUSv3, it seems like the most practical way.  SUSv3 doesn't know
about EMSGSIZE (at least not in recv() and friends) but the function just
returns the number of bytes copied to the buffer and discards all remaining
bytes in case of message-oriented sockets, except if MSG_PEEK is given.

So it seems to be most useful to change recvfrom so that in case of
SOCKET_ERROR it checks for WSAEMSGSIZE and returns the buffer size instead,
not setting errno at all.

I'll check that change in.

> Now in poll since we will now be returning the number of bytes instead 
> of -1, do we will need to check for WSAEMSGSIZE?  I don't think so 
> because that will now be handled in recvfrom.
> 
> Is this correct?

Yes, AFAICS.  Would you mind to test the next developers snapshot?

Thanks for the discussion of that problem,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.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/

