查 看错误代码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 */
#define EL3HLT 46 /* Level 3 halted */
#define EL3RST 47 /* Level 3 reset */
#define ELNRNG 48 /* Link number out of range */
#define EUNATCH 49 /* Protocol driver not attached */
#define ENOCSI 50 /* No CSI structure available */
#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 */
#define ENOPROTOOPT 92 /* Protocol not available */
#define EPROTONOSUPPORT 93 /* Protocol not supported */
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
#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 */
#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 */
#define EDQUOT 122 /* Quota exceeded */
#define ENOMEDIUM 123 /* No medium found */
#define EMEDIUMTYPE 124 /* Wrong medium type */
#endif

linux中各种error意思相关推荐

  1. linux vim m,关于linux中使用vim打开文件出现^M的解决方法

    在linux下,不可避免的会用VIM打开一些windows下编辑过的文本文件.我们会发现文件的每行结尾都会有一个^M符号,这是因为 DOS下的编辑器和Linux编辑器对文件行末的回车符处理不一致, 各 ...

  2. Linux中使用gcp拷贝报错:dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported:

    1 在linux中使用gcp拷贝的时候报错 Linux中使用gcp拷贝报错:dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotS ...

  3. linux修改密码提示unix,linux中普通用户批改密码出现(passwd:Authentication token manipulation error)...

    linux中普通用户修改密码出现(passwd:Authentication token manipulation error) 如果在linux中,不管是root用户还是普通用户登录后,修改自己的密 ...

  4. linux中浏览器连不上网络,在Linux中修复Firefox浏览器“Network Protocol Error”错误的方法...

    本文介绍在Linux中修复Mozilla Firefox浏览器上的Network Protocol Error错误,即网络协议错误.安装Firefox可以参考在Debian 9 Stretch系统上安 ...

  5. linuX中error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/urllib3....

    linuX中error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/urllib3/packages/s ...

  6. linux编译lame,技术|Linux 有问必答:如何在Linux中修复“fatal error: lame/lame.h: No such file or dir...

    提问: 我尝试着在Linux中编译视频编码器,但是编译提示出错:"fatal error: lame/lame.h: No such file or directory", 我该如 ...

  7. 报错处理: syntax error near unexpected token `$‘\r‘‘ (linux中的^M)

    1 问题描述 在windows 上使用MobaXTerm,在远程linux服务器上写脚本的时候,遇到了一个问题 windows操作系统 ssh 工具介绍:MobaXterm_UQI-LIUWJ的博客- ...

  8. Linux中 [Error 28] 设备上没有空间

    在Linux中设备空间有两个条件决定的:硬盘容量 和 索引节点(Inode) 硬盘容量: 即硬盘可用容量 Inode : 即索引节点编号(记录文件的大小.拥有者.权限.区块地方等信息,可以通过 sta ...

  9. 在Linux中安装MySQL报错“error: Failed dependencies: mysql-community-libs(x86-32) >= 5.7.9 is needed by my“

    异常 在Linux中安装MySQL报错: 原因 因为缺少相关的依赖,所以要先安装这些依赖才能安装MySQL成功. 解决 (注意:这种方法是错误的,安装后并不能启动MySQL成功) 在每个安装指令后面添 ...

最新文章

  1. 一次被僵尸网络病毒攻击的过程
  2. C语言内存/指针相关
  3. python安装Scrapy踩过的坑以及安装指导
  4. Maven构建分布式项目时子模块相互依赖打包技巧
  5. bat代码雨代码流星_bat-入门系列-03-判断结构2
  6. Oracle分页排序采坑记录
  7. 【英语学习】【WOTD】shard 释义/词源/示例
  8. 吃瓜笔记 | 旷视研究院解读Light-Head R-CNN:平衡精准度和速度
  9. vulhub靶场sql注入漏洞复现
  10. 计算机id和密码忘了怎么办,苹果账号密码忘记了怎么办_苹果忘了id账号和密码的处理方法...
  11. 阿里云免费服务器ECS秒杀js脚本
  12. android qq音乐 搜索,QQ音乐搜索功能基本思路
  13. pandas从入门到进阶
  14. 扫码反馈,“码”上回复:二维码在业主意见反馈中的应用
  15. 前端 115道 面试题总结【持续更新...】
  16. MATLAB实现小波变换去噪
  17. 八码数-IDA*算法
  18. java车间调度算法_混合算法(GA+TS)求解作业车间调度问题代码解读+完整JAVA代码...
  19. 毕业设计-基于机器视觉的指针式仪表读数自动识别研究与实现
  20. HTK搭建大词汇量连续语音识别系统(一)

热门文章

  1. 在Chrome 浏览器上滚动截屏
  2. 判断一个多边形是否是凸多边形
  3. java的int转long
  4. 记录一次扇贝网前端实习面试
  5. 【转载】基于Office Online Server 2016 的office在线编辑
  6. 解决maven项目中-Dmaven.multiModuleProjectDirectory报错问题
  7. 【学习笔记】URL和DOI是什么?有什么区别?
  8. 网络地址不在同一网段能通信吗
  9. 致远项目管理SPM系统核心价值
  10. iframe中的方法