现在的位置: 首页 > 综合 > 正文

errno.h

2013年09月02日 ⁄ 综合 ⁄ 共 6150字 ⁄ 字号 评论关闭
查看错误代码errno是调试程序的一个重要方法。当linuc C api函数发生异常时,一般会将errno变量(需include errno.h)赋一个整数值,不同的值表示不同的含义,可以通过查看该值推测出错的原因。在实际编程中用这一招解决了不少原本看来莫名其妙的问题。比较麻烦的是每次都要去linux源代码里面查找错误代码的含义,现在把它贴出来,以后需要查时就来这里看了。
以下来自linux 2.4.20-18的内核代码中的/usr/include/asm/errno.h
#ifndef _I386_ERRNO_H
#define _I386_ERRNO_H
#define EPERM   1 /* Operation not permitted */操作不允许
#define ENOENT   2 /* No such file or directory */文件或目录不存在
#define ESRCH   3 /* No such process */进程不存在
#define EINTR   4 /* Interrupted system call */中断系统调用
#define EIO       5 /* I/O error */   输入/输出错误
#define ENXIO   6 /* No such device or address */设备(地址)不存在
#define E2BIG   7 /* Arg list too long */参数过长
#define ENOEXEC   8 /* Exec format error */格式化出错
#define EBADF   9 /* Bad file number */错误文件号???
#define ECHILD  10 /* No child processes */没有子进程
#define EAGAIN  11 /* Try again */重试
#define ENOMEM  12 /* Out of memory */内存溢出
#define EACCES  13 /* Permission denied */没有权限
#define EFAULT  14 /* Bad address */地址错误???
#define ENOTBLK  15 /* Block device required */缺少块设备
#define EBUSY  16 /* Device or resource busy */设备(或资源)忙
#define EEXIST  17 /* File exists */文件已存在
#define EXDEV  18 /* Cross-device link */交叉设备链接???
#define ENODEV  19 /* No such device */设备不存在
#define ENOTDIR  20 /* Not a directory */目录不存在
#define EISDIR  21 /* Is a directory */是目录
#define EINVAL  22 /* Invalid argument */参数无效
#define ENFILE  23 /* File table overflow */文件列表溢出???
#define EMFILE  24 /* Too many open files */太多打开的文件
#define ENOTTY  25 /* Not a typewriter */非写类型
#define ETXTBSY  26 /* Text file busy */文件忙
#define EFBIG  27 /* File too large */文件太大
#define ENOSPC  28 /* No space left on device */设备空间不足
#define ESPIPE  29 /* Illegal seek */非法搜索
#define EROFS  30 /* Read-only file system */只读文件系统
#define EMLINK  31 /* Too many links */太多链接
#define EPIPE  32 /* Broken pipe */坏管道(不可用的管道)???
#define EDOM  33 /* Math argument out of domain of func */
#define ERANGE  34 /* Math result not representable */运算结果不能被表示???
#define EDEADLK  35 /* Resource deadlock would occur */资源死锁
#define ENAMETOOLONG 36 /* File name too long */文件名过长
#define ENOLCK  37 /* No record locks available */没有记录锁可用???
#define ENOSYS  38 /* Function not implemented */功能不完整
#define ENOTEMPTY 39 /* Directory not empty */目录不为空
#define ELOOP  40 /* Too many symbolic links encountered */计算了太多软连接???
#define EWOULDBLOCK EAGAIN /* Operation would block */操作将被阻塞
#define ENOMSG  42 /* No message of desired type */
#define EIDRM  43 /* Identifier removed */标识已被删除???
#define ECHRNG  44 /* Channel number out of range */通道号超过范围???
#define EL2NSYNC 45 /* Level 2 not synchronized */level2不同步???
#define EL3HLT  46 /* Level 3 halted */ level3停止???
#define EL3RST  47 /* Level 3 reset */重置level3???
#define ELNRNG  48 /* Link number out of range */超过链接数
#define EUNATCH  49 /* Protocol driver not attached */协议驱动无法连接???
#define ENOCSI  50 /* No CSI structure available */CSI结构不可用???
#define EL2HLT  51 /* Level 2 halted */
#define EBADE  52 /* Invalid exchange */无效交换
#define EBADR  53 /* Invalid request descriptor */无效请求符号
#define EXFULL  54 /* Exchange full */交换满
#define ENOANO  55 /* No anode */
#define EBADRQC  56 /* Invalid request code */无效请求码
#define EBADSLT  57 /* Invalid slot */无效槽???
#define EDEADLOCK EDEADLK
#define EBFONT  59 /* Bad font file format */无效文件格式字体???
#define ENOSTR  60 /* Device not a stream */非流设备
#define ENODATA  61 /* No data available */无数据可用
#define ETIME  62 /* Timer expired */计时器失效
#define ENOSR  63 /* Out of streams resources */资源流溢出???
#define ENONET  64 /* Machine is not on the network */机器不在网络上??
#define ENOPKG  65 /* Package not installed */包没安装
#define EREMOTE  66 /* Object is remote */对象是远程的
#define ENOLINK  67 /* Link has been severed */服务正在等待连接???
#define EADV  68 /* Advertise error */公告错误
#define ESRMNT  69 /* Srmount error */
#define ECOMM  70 /* Communication error on send */发送出错
#define EPROTO  71 /* Protocol error */协议错误
#define EMULTIHOP 72 /* Multihop attempted */
#define EDOTDOT  73 /* RFS specific error */
#define EBADMSG  74 /* Not a data message */没有数据信息
#define EOVERFLOW 75 /* Value too large for defined data type */数据超过了类型的最大限制
#define ENOTUNIQ 76 /* Name not unique on network */名字和网络上的冲突
#define EBADFD  77 /* File descriptor in bad state */文件描述器
#define EREMCHG  78 /* Remote address changed */远程地址发生变化
#define ELIBACC  79 /* Can not access a needed shared library */无法访问需要的共享库
#define ELIBBAD  80 /* Accessing a corrupted shared library */正在访问损坏的共享库
#define ELIBSCN  81 /* .lib section in a.out corrupted */
#define ELIBMAX  82 /* Attempting to link in too many shared libraries */
#define ELIBEXEC 83 /* Cannot exec a shared library directly */无法直接执行共享库???
#define EILSEQ  84 /* Illegal byte sequence */非法字节流?
#define ERESTART 85 /* Interrupted system call should be restarted */中断调用需要重启
#define ESTRPIPE 86 /* Streams pipe error */流管道错误?
#define EUSERS  87 /* Too many users */用户过多
#define ENOTSOCK 88 /* Socket operation on non-socket */???
#define EDESTADDRREQ 89 /* Destination address required */缺少目的地址
#define EMSGSIZE 90 /* Message too long */消息过长
#define EPROTOTYPE 91 /* Protocol wrong type for socket */socket的协议类型错误??
#define ENOPROTOOPT 92 /* Protocol not available */协议不可用
#define EPROTONOSUPPORT 93 /* Protocol not supported */协议不支持
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */socket类型不支持
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */交换端不支持此操作???
#define EPFNOSUPPORT 96 /* Protocol family not supported */协议族不支持
#define EAFNOSUPPORT 97 /* Address family not supported by protocol */协议不支持该地址族
#define EADDRINUSE 98 /* Address already in use */地址已被使用
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */无法签约需要的地址?
#define ENETDOWN 100 /* Network is down */网络不可用?
#define ENETUNREACH 101 /* Network is unreachable */网络不可达
#define ENETRESET 102 /* Network dropped connection because of reset */网络因为重置而断开
#define ECONNABORTED 103 /* Software caused connection abort */软件引发连接终止
#define ECONNRESET 104 /* Connection reset by peer */连接被peer重置???
#define ENOBUFS  105 /* No buffer space available */没有缓冲区可用
#define EISCONN  106 /* Transport endpoint is already connected */交换终端已连接?
#define ENOTCONN 107 /* Transport endpoint is not connected */交换终端没有连接?
#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */无法发送 交换终端已关闭
#define ETOOMANYREFS 109 /* Too many references: cannot splice */太多参数:无法拼接
#define ETIMEDOUT 110 /* Connection timed out */连接超时
#define ECONNREFUSED 111 /* Connection refused */连接被拒
#define EHOSTDOWN 112 /* Host is down */主机不可用
#define EHOSTUNREACH 113 /* No route to host */没有可达路由?
#define EALREADY 114 /* Operation already in progress */操作已在进程
#define EINPROGRESS 115 /* Operation now in progress */操作已加入进程
#define ESTALE  116 /* Stale NFS file handle */
#define EUCLEAN  117 /* Structure needs cleaning */结构需要清理
#define ENOTNAM  118 /* Not a XENIX named type file */
#define ENAVAIL  119 /* No XENIX semaphores available */
#define EISNAM  120 /* Is a named type file */命名类型文件
#define EREMOTEIO 121 /* Remote I/O error */远程 I/O 错误
#define EDQUOT  122 /* Quota exceeded */超出限额
#define ENOMEDIUM 123 /* No medium found */没发现媒介
#define EMEDIUMTYPE 124 /* Wrong medium type */媒介类型错误
#endif

抱歉!评论已关闭.