[parisc-linux] Re: EWOULDBLOCK vs. EAGAIN

John David Anglin dave@hiauly1.hia.nrc.ca
Tue, 22 Oct 2002 11:58:12 -0400 (EDT)


> Yes, to be completely portable across other Unix flavors, you should
> check for both EAGAIN and EWOULDBLOCK. But it would appear that
> Gnu C library documentation says they should be the same, and they
> ARE the same on all other Linux architectures. So, in my opinion,
> we are broken, not the apps.

I just looked at expect.  It uses 

#ifdef EAGAIN
        case EAGAIN: return "resource temporarily unavailable";
#endif
...
#if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK))
        case EDEADLK: return "resource deadlock avoided";
#endif
#if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK))
	case EDEADLOCK: return "resource deadlock avoided";
#endif
...
#if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
        case EWOULDBLOCK: return "operation would block";
#endif

This seems portable to me.

I agree that the definition of EWOULDBLOCK should be the same as on
other Linux architectures.  However, I think that apps should work
irrespective of whether they are the same or not.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)