首页 / 软件开发 / C++ / Linux errno 错误对照表
Linux errno 错误对照表2014-11-02errno 在 <errno.h> 中定义,错误 Exx 的宏定义在 /usr/include/asm-generic 文件夹下面的 errno-base.h 和 errno.h,分别定义了 1-34 、35-132 的错误定义。strerror() 函数依据 errno 值返回错误描述字符串,下面程序打印对照表:01.#include <errno.h>02.#include <string.h>03.#include <stdio.h>04.05.int main()06.{07. int i;08. for(i = 0; i < 140; ++i)09. {10. errno = i;11. printf("errno %d : %s+n",i,strerror(errno));12. }13. return 0;14.}错误对照表:errno0 : Successerrno1 : Operation not permittederrno2 : No such file or directoryerrno3 : No such processerrno4 : Interrupted system callerrno5 : Input/output errorerrno6 : No such device or addresserrno7 : Argument list too longerrno8 : Exec format errorerrno9 : Bad file descriptorerrno10 : No child processeserrno11 : Resource temporarily unavailableerrno12 : Cannot allocate memoryerrno13 : Permission deniederrno14 : Bad addresserrno15 : Block device requirederrno16 : Device or resource busyerrno17 : File existserrno18 : Invalid cross-device linkerrno19 : No such deviceerrno20 : Not a directoryerrno21 : Is a directoryerrno22 : Invalid argumenterrno23 : Too many open files in system更多精彩内容:http://www.bianceng.cn/Programming/cplus/