unix - 哪些系统将EAGAIN和EWOULDBLOCK定义为不同的值?

标签 unix posix errno

只是好奇。哪些同时提供EAGAIN和EWOULDBLOCK的系统将它们的#define编码为不同的值?

最佳答案

有一些... 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...



较旧的AIX也是这样的系统:http://programming.itags.org/unix-linux-programming/81597/

HP-UX (and older versions of AIX)



对于AIX,我找到了代码列表:http://homepage3.nifty.com/owl_h0h0/unix/job/UNIX/tutorial/error.html

11 EAGAIN; 54 EWOULDBLOCK



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

OS/390 and other platforms where EWOULDBLOCK != EAGAIN



有更完整的表: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

因此,AIX 4.3,5.1; HP-UX 11.22和OSF1对EAGAIN和EWOULDBLOCK使用不同的代码

关于unix - 哪些系统将EAGAIN和EWOULDBLOCK定义为不同的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7003234/

相关文章:

c - 如何将我的错误描述添加到 perror 函数

php - 当使用 CPPFLAGS 指定目录时./configure 无法找到头文件

bash - Unix 脚本无法更改 Ubuntu 上的 postgres hba.conf 配置文件

unix - 在 Nginx access.log 中获取每个 IP 每个请求的请求计数

mysql - 如何修复 InnoDB 损坏,从创建中锁定表名(errno : -1) on AWS RDS?

c - 为什么 fopen() 或 open() 使用 errno 而不是只返回错误代码?

检查 elf 可执行文件是否在 UNIX 上使用 GUI 或 CUI 运行

linux - 这是如何使用 poll(2) 的 posix 队列?

android - 如何成功编译Android版libupnp

c - Posix named lock inter process 什么与多线程应用程序一起工作?