查看错误代码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中错误编号对应意思相关推荐

  1. linux中错误总结归纳

    1.使用gcc编译C文件,C文件在for循环语句中出现变量定义 编译器提示错误:"for"loop initial declarations are only allowed in ...

  2. linux中错误日志等级

    info:仅是一些基本的讯息说明而已: notice:比 info 还需要被注意到的一些信息内容: warning 或 warn:警示讯息,可能有问题,但是还不至于影响到某个 daemon 作. er ...

  3. linux中错误无法解析域名无法下载,Linux无法解析域名的解决办法

    如果由于误操作,删除了系统原有的dhcp相关设置就无法正常解析域名. 此时,需要手动修改配置文件: /etc/resolv.conf 将域名解析服务器手动添加到配置文件中 该文件是DNS域名解析的配置 ...

  4. 关于Linux中使用USE(使用率/饱和度/错误)方法分析系统性能的一些笔记

    写在前面 今天和小伙伴们分享通过USE方法对系统进行性能分析和性能调整 博文内容涉及: 什么是USE方法,以及USE的使用建议 具体的USE指标采集分析 食用方式: 需要Linux基础知识 理解不足小 ...

  5. linux查看告警日志,shell脚本,用于监视Linux中的消息日志(警告,错误和严重)...

    shell脚本,用于监视Linux中的消息日志(警告,错误和严重) 该脚本将检查文件中的"警告,错误和严重",并在/var/log/messages找到与之相关的邮件时触发给指定电 ...

  6. gcc -pthread_错误-在GCC Linux中使用C程序未定义对'pthread_create'的引用

    gcc -pthread 在Linux中修复对'pthread_create'的未定义引用 (Fixing undefined reference to 'pthread_create' in Lin ...

  7. linux中运行ifconfig出现错误,不能sudo apt install net-tools,Linux不能联网

    linux中运行ifconfig出现错误,且不能sudo apt install net-tools linux中运行ifconfig出现错误 不能sudo apt install net-tools ...

  8. Linux中的基本命令无法使用,报Command not found的错误的解决方法

    Linux中的基本命令无法使用,报Command not found的错误的解决方法 参考文章: (1)Linux中的基本命令无法使用,报Command not found的错误的解决方法 (2)ht ...

  9. 以下对linux中线程描述错误的是,2008年9月全国计算机等级三级PC技术真题

    单项选择题 1.  下列关于计算机性能的叙述中,错误的是 A)CPU的工作频率越高, 处理速度就越快 B)总线的传输速率与总线的时钟频率及总线的宽度有关 C)主存的存储周期越长,存取速度就越快 D)通 ...

最新文章

  1. if(window.event) e = window.event
  2. pandas使用transpose函数对dataframe进行转置、将dataframe的行和列进行互换(flip the rows and columns in dataframe)
  3. 25.CSS其他样式
  4. JVMTM Tool Interface
  5. Sqoop的安装配置及工作机制
  6. 东半球最全的 postman 使用教程
  7. 30 道 MySQL 面试题全放送!
  8. linux 历史命令列表,LinuxShell命令history
  9. 百度地图与 select下拉框的双向维护
  10. 计算机应用基础2-excel,《2014计算机应用基础excel2.doc
  11. 不定积分24个基本公式整理
  12. 版本控制选择SVN还是Git?
  13. 如何修改ns服务器,Godaddy如何修改NS信息
  14. MYS-6ULX-IOT 开发板测评——实现简单的物联网应用
  15. 打砖块python游戏源代码_python制作一个打砖块小游戏
  16. toolbar遇到问题和解决方式
  17. 将文件夹下的pdf文件合并
  18. Blink是如何工作的
  19. python电子签章_签名python的搜索结果-阿里云开发者社区
  20. 规模破万亿,助力支付发展丨在线旅游市场你不知道的那些事

热门文章

  1. HTML实现遮罩层的方法 HTML中如何使用遮罩层
  2. kotlin基础教程:<6>map集合
  3. syslog日志服务
  4. tar 将软连接的文件也进行打包
  5. 将cmder安装到windows xp上
  6. 一文看懂Web3.0:元宇宙的基础设施,三大标签颠覆互联网
  7. Windows10 微软拼音繁简切换快捷键
  8. UVM-config机制
  9. 《福布斯》评出全球十大豪华手机 Vertu居首
  10. MyEclipse如何配置Tomcat