Xlib and EAGAIN

Ander Conselvan de Oliveira ander at c3sl.ufpr.br
Thu Aug 10 15:20:57 PDT 2006

Alan Cox wrote:
> Ar Iau, 2006-08-10 am 15:28 -0300, ysgrifennodd Ander Conselvan de
> Oliveira:
>> Is there any reason to test for EAGAIN on this Unix variant and not on 
>> the others?
> I have vague memories from way back when that ISC Unix returned EAGAIN
> for many things BSD used EWOULDBLOCK and that the errno codes were
> different.

if WIN32 and CYGWIN are not defined, the ETEST macro is defined as follows.

#if defined(EAGAIN) && defined(EWOULDBLOCK)
#define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK)

Later, the ECHECK macro is defined to use the ETEST macro, but only in 
ISC linux.

#ifdef ISC
#define ECHECK(err) ((errno == err) || ETEST())
#define ECHECK(err) (errno == err)

I just want to know if it makes sense to define the ECHECK macro to use 
the ETEST macro for all unices. At least it solves my problem with Linux.


Ander Conselvan de Oliveira
C3SL - Centro de Computação Científica e Software Livre

More information about the xorg mailing list