Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
628 views
in Technique[技术] by (71.8m points)

unix - Which systems define EAGAIN and EWOULDBLOCK as different values?

Just curious. Which systems providing both EAGAIN and EWOULDBLOCK #define them as different values?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There were some... http://www.gnu.org/s/hello/manual/libc/Error-Codes.html

Portability Note: In many older Unix systems, this condition was indicated by EWOULDBLOCK, which was a distinct error code different from EAGAIN. To make your program portable, you should check for both codes and treat them the same.

http://lists.parisc-linux.org/hypermail/parisc-linux/9895.html

On some SysV systems EAGAIN != EWOULDBLOCK. I think we inherited the errno definitions from HPUX...

Older AIX is such system too: http://programming.itags.org/unix-linux-programming/81597/

HP-UX (and older versions of AIX)

For AIX I found the list of codes: http://homepage3.nifty.com/owl_h0h0/unix/job/UNIX/tutorial/error.html

11 EAGAIN; 54 EWOULDBLOCK

OS/390 too: http://web.archiveorange.com/archive/v/zvbaIz8u6TzsQHHjfzOi

OS/390 and other platforms where EWOULDBLOCK != EAGAIN

There is fuller table: http://www.ioplex.com/~miallen/errcmp.html

        SUSv3   AIX 4.3,5.1 HP-UX 11.22 Solaris 9,10    Linux 2.4.28,2.6.9  IRIX 6.5[4] OSF1    FreeBSD 5.2.1   OSX 10.3.8  MSVC6
EAGAIN  1   0   Resource unavailable, try again [3] 11  Resource temporarily unavailable    11  No more processes   11  Resource temporarily unavailable    11  Try again   11  Resource temporarily unavailable    11  ditto   35  Resource temporarily unavailable    35  Resource temporarily unavailable    11  Resource temporarily unavailable

EWOULDBLOCK 0.9 0   Operation would block [3]   54  Operation would block [2]   246 Operation would block   11      11  Operation would block   11  Resource temporarily unavailable    35  Operation would block   35  Operation would block   35  Operation would block

So, AIX 4.3,5.1; HP-UX 11.22 and OSF1 uses different codes for EAGAIN and EWOULDBLOCK


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...