Xlib and EAGAIN

Ander Conselvan de Oliveira ander at c3sl.ufpr.br
Wed Aug 9 11:31:52 PDT 2006


Hello,

I'm running a multiseat system with the Xephyr nested xserver. In this 
environment, four instances of Xephyr run over an instance of a 
multihead Xorg.

When running animations or intense graphics applications, like flash 
animations, some of the Xephyr dies with the following message:

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X ...

Looking at the code of Xlib, I found out that for ISC is defined (not 
quite sure what this means), the ECHECK macro is defined to also check 
for EAGAIN and EWOULDBLOCK.

Since the EAGAIN is not fatal, it seems that this definition should be 
used in the common case.

The relevant part of XlibInt.c follows

#ifdef WIN32
#define ETEST() (WSAGetLastError() == WSAEWOULDBLOCK)
#else
#ifdef __CYGWIN__ /* Cygwin uses ENOBUFS to signal socket is full */
#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK || errno == 
ENOBUFS)
#else
#if defined(EAGAIN) && defined(EWOULDBLOCK)
#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK)
#else
#ifdef EAGAIN
#define ETEST() (errno == EAGAIN)
#else
#define ETEST() (errno == EWOULDBLOCK)
#endif /* EAGAIN */
#endif /* EAGAIN && EWOULDBLOCK */
#endif /* __CYGWIN__ */
#endif /* WIN32 */

#ifdef WIN32
#define ECHECK(err) (WSAGetLastError() == err)
#define ESET(val) WSASetLastError(val)
#else
#ifdef __UNIXOS2__
#define ECHECK(err) (errno == err)
#define ESET(val)
#else
#ifdef ISC
#define ECHECK(err) ((errno == err) || ETEST())
#else
#define ECHECK(err) (errno == err)
#endif
#define ESET(val) errno = val
#endif
#endif

Thanks,
Ander

-- 
Ander Conselvan de Oliveira
C3SL - Centro de Computação Científica e Software Livre
www.c3sl.ufpr.br



More information about the xorg mailing list