This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.3.19-1:poll bug. Patch included.

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 Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]