Welcome

首页 / 软件开发 / 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 : Success

errno1 : Operation not permitted

errno2 : No such file or directory

errno3 : No such process

errno4 : Interrupted system call

errno5 : Input/output error

errno6 : No such device or address

errno7 : Argument list too long

errno8 : Exec format error

errno9 : Bad file descriptor

errno10 : No child processes

errno11 : Resource temporarily unavailable

errno12 : Cannot allocate memory

errno13 : Permission denied

errno14 : Bad address

errno15 : Block device required

errno16 : Device or resource busy

errno17 : File exists

errno18 : Invalid cross-device link

errno19 : No such device

errno20 : Not a directory

errno21 : Is a directory

errno22 : Invalid argument

errno23 : Too many open files in system

更多精彩内容:http://www.bianceng.cn/Programming/cplus/