XIO error... anyone seen it? [found and fixed]

Christopher Faylor cgf@redhat.com
Thu Nov 8 15:43:00 GMT 2001


On Thu, Nov 08, 2001 at 11:10:28PM +0000, Alan Hourihane wrote:
>On Thu, Nov 08, 2001 at 02:17:49PM -0800, Brian Genisio wrote:
>> Should we add the folowing line to XlibInt.c?  :
>> #ifdef __CYGWIN__
>> #define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS)
>> 
>> Or, is there a better solution? What do you (Cyg/XF86 developers) think?
>
>Seems like a reasonable assessment Brian. We could do this, although I'd
>like to understand why there isn't any buffer space on the socket. 
>
>Is there a test application you can email to me for testing..?

I wonder if cygwin should just be mapping WSAENOBUFS to EAGAIN.  It seems like
we somehow invented a new errno here.

Regardless, where errno tests are concerned, I think it makes sense to do
something like this:

#ifdef ENOBUFS /* ENOBUFS is apparently a Cygwin-specific errno */
#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS)
#endif

That means that you are relying on the existence of the errno rather than
the fact that it is cygwin.

So, if we decide to deprecate ENOBUFS sometime in the future, the code will
still compile correctly.

Nice debugging effort, by the way.

cgf



More information about the Cygwin-xfree mailing list