This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


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

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


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


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