Skip to contentSkip to conversation

EWOULDBLOCK vs. EAGAIN

parisc-linux John Marvin 2 participants 2 messages Oct 22, 2002

lore
Share & tools
lore
#0 lore raw

I found a bug last night where a program was expecting EWOULDBLOCK, but we were returning EAGAIN. The kernel returns EAGAIN, which is correct. However, the Gnu C library says that EWOULDBLOCK should be defined as the same thing. We didn't do that on parisc linux. Probably because we borrowed our errno's from HP-UX. But that is wrong.

So, how should we fix this? I don't think we can avoid breaking binary compatibility. The problem is that the kernel returns EWOULDBLOCK in some cases (I've enclosed a list of files that might affect us below, file locking and usb being the ones that are most likely to affect us).

I think we should change errno.h to define EWOULDBLOCK as EAGAIN. That will fix some programs once they are recompiled. Of course, it will break some others, but they will also be fixed once again once they are recompiled.

How hard would it be to grep the source of all debian packages, so we can find which packages should be rebuilt?

John

#1 lore raw
Quoted 5 lines

I found a bug last night where a program was expecting EWOULDBLOCK, but we were returning EAGAIN. The kernel returns EAGAIN, which is correct. However, the Gnu C library says that EWOULDBLOCK should be defined as the same thing. We didn't do that on parisc linux. Probably because we borrowed our errno's from HP-UX. But that is wrong.

jsm,

this was discussed briefly before, but no one has fixed it yet ... see Carlos' post on this subject:
http://lists.parisc-linux.org/hypermail/parisc-linux/9895.html

if people think that is a good solution, we can try to do it.

randolph

Signature · 3 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/