linux系统中errno与error对照表

简介:

1、使用了一个小程序输出所有的errno对应的error字符串,代码如下

#include <errno.h>

void showError(int err)
{
  printf("errno : %5d , error : %s\n", err, strerror(err));
}

void showAllErr() 
{
  int i = 0; 
  for(;i < 256; i++)
  {
    showError(i);
  }
}

int main(int argc, char * argv[])
{
  showAllErr();

  return 0;
}

 

2、运行上面代码,结果如下

errno : 0 , error : Success
errno : 1 , error : Operation not permitted
errno : 2 , error : No such file or directory
errno : 3 , error : No such process
errno : 4 , error : Interrupted system call
errno : 5 , error : Input/output error
errno : 6 , error : No such device or address
errno : 7 , error : Argument list too long
errno : 8 , error : Exec format error
errno : 9 , error : Bad file descriptor
errno : 10 , error : No child processes
errno : 11 , error : Resource temporarily unavailable
errno : 12 , error : Cannot allocate memory
errno : 13 , error : Permission denied
errno : 14 , error : Bad address
errno : 15 , error : Block device required
errno : 16 , error : Device or resource busy
errno : 17 , error : File exists
errno : 18 , error : Invalid cross-device link
errno : 19 , error : No such device
errno : 20 , error : Not a directory
errno : 21 , error : Is a directory
errno : 22 , error : Invalid argument
errno : 23 , error : Too many open files in system
errno : 24 , error : Too many open files
errno : 25 , error : Inappropriate ioctl for device
errno : 26 , error : Text file busy
errno : 27 , error : File too large
errno : 28 , error : No space left on device
errno : 29 , error : Illegal seek
errno : 30 , error : Read-only file system
errno : 31 , error : Too many links
errno : 32 , error : Broken pipe
errno : 33 , error : Numerical argument out of domain
errno : 34 , error : Numerical result out of range
errno : 35 , error : Resource deadlock avoided
errno : 36 , error : File name too long
errno : 37 , error : No locks available
errno : 38 , error : Function not implemented
errno : 39 , error : Directory not empty
errno : 40 , error : Too many levels of symbolic links
errno : 41 , error : Unknown error 41
errno : 42 , error : No message of desired type
errno : 43 , error : Identifier removed
errno : 44 , error : Channel number out of range
errno : 45 , error : Level 2 not synchronized
errno : 46 , error : Level 3 halted
errno : 47 , error : Level 3 reset
errno : 48 , error : Link number out of range
errno : 49 , error : Protocol driver not attached
errno : 50 , error : No CSI structure available
errno : 51 , error : Level 2 halted
errno : 52 , error : Invalid exchange
errno : 53 , error : Invalid request descriptor
errno : 54 , error : Exchange full
errno : 55 , error : No anode
errno : 56 , error : Invalid request code
errno : 57 , error : Invalid slot
errno : 58 , error : Unknown error 58
errno : 59 , error : Bad font file format
errno : 60 , error : Device not a stream
errno : 61 , error : No data available
errno : 62 , error : Timer expired
errno : 63 , error : Out of streams resources
errno : 64 , error : Machine is not on the network
errno : 65 , error : Package not installed
errno : 66 , error : Object is remote
errno : 67 , error : Link has been severed
errno : 68 , error : Advertise error
errno : 69 , error : Srmount error
errno : 70 , error : Communication error on send
errno : 71 , error : Protocol error
errno : 72 , error : Multihop attempted
errno : 73 , error : RFS specific error
errno : 74 , error : Bad message
errno : 75 , error : Value too large for defined data type
errno : 76 , error : Name not unique on network
errno : 77 , error : File descriptor in bad state
errno : 78 , error : Remote address changed
errno : 79 , error : Can not access a needed shared library
errno : 80 , error : Accessing a corrupted shared library
errno : 81 , error : .lib section in a.out corrupted
errno : 82 , error : Attempting to link in too many shared libraries
errno : 83 , error : Cannot exec a shared library directly
errno : 84 , error : Invalid or incomplete multibyte or wide character
errno : 85 , error : Interrupted system call should be restarted
errno : 86 , error : Streams pipe error
errno : 87 , error : Too many users
errno : 88 , error : Socket operation on non-socket
errno : 89 , error : Destination address required
errno : 90 , error : Message too long
errno : 91 , error : Protocol wrong type for socket
errno : 92 , error : Protocol not available
errno : 93 , error : Protocol not supported
errno : 94 , error : Socket type not supported
errno : 95 , error : Operation not supported
errno : 96 , error : Protocol family not supported
errno : 97 , error : Address family not supported by protocol
errno : 98 , error : Address already in use
errno : 99 , error : Cannot assign requested address
errno : 100 , error : Network is down
errno : 101 , error : Network is unreachable
errno : 102 , error : Network dropped connection on reset
errno : 103 , error : Software caused connection abort
errno : 104 , error : Connection reset by peer
errno : 105 , error : No buffer space available
errno : 106 , error : Transport endpoint is already connected
errno : 107 , error : Transport endpoint is not connected
errno : 108 , error : Cannot send after transport endpoint shutdown
errno : 109 , error : Too many references: cannot splice
errno : 110 , error : Connection timed out
errno : 111 , error : Connection refused
errno : 112 , error : Host is down
errno : 113 , error : No route to host
errno : 114 , error : Operation already in progress
errno : 115 , error : Operation now in progress
errno : 116 , error : Stale file handle
errno : 117 , error : Structure needs cleaning
errno : 118 , error : Not a XENIX named type file
errno : 119 , error : No XENIX semaphores available
errno : 120 , error : Is a named type file
errno : 121 , error : Remote I/O error
errno : 122 , error : Disk quota exceeded
errno : 123 , error : No medium found
errno : 124 , error : Wrong medium type
errno : 125 , error : Operation canceled
errno : 126 , error : Required key not available
errno : 127 , error : Key has expired
errno : 128 , error : Key has been revoked
errno : 129 , error : Key was rejected by service
errno : 130 , error : Owner died
errno : 131 , error : State not recoverable
errno : 132 , error : Operation not possible due to RF-kill
errno : 133 , error : Unknown error 133
.

.

.

errno : 255 , error : Unknown error 255

当errno到达134的时候就没有错误了~



本文转自郝峰波博客园博客,原文链接:http://www.cnblogs.com/fengbohello/p/4692753.html,如需转载请自行联系原作者


相关文章
|
6天前
|
资源调度 JavaScript 搜索推荐
Linux系统之部署envlinks极简个人导航页
【4月更文挑战第11天】Linux系统之部署envlinks极简个人导航页
40 2
|
9天前
|
缓存 Linux 测试技术
安装【银河麒麟V10】linux系统--并挂载镜像
安装【银河麒麟V10】linux系统--并挂载镜像
58 0
|
9天前
|
监控 Unix Linux
Linux操作系统调优相关工具(四)查看Network运行状态 和系统整体运行状态
Linux操作系统调优相关工具(四)查看Network运行状态 和系统整体运行状态
26 0
|
16天前
|
存储 前端开发 Linux
Linux系统之部署ToDoList任务管理工具
【4月更文挑战第1天】Linux系统之部署ToDoList任务管理工具
61 1
|
17天前
|
存储 传感器 运维
linux系统资源统计工具
【4月更文挑战第1天】Linux系统监控工具如dstat、htop、glances、vmstat、top、iostat、mpstat、sar和atop,用于跟踪CPU、内存、磁盘I/O、网络和进程性能。这些工具提供实时、交互式和历史数据分析,助力管理员优化系统性能和故障排查。例如,dstat是vmstat等工具的增强版,htop提供彩色界面的进程管理,而atop则结合了多种功能并记录历史数据。
27 5
linux系统资源统计工具
|
7天前
|
存储 算法 Linux
【实战项目】网络编程:在Linux环境下基于opencv和socket的人脸识别系统--C++实现
【实战项目】网络编程:在Linux环境下基于opencv和socket的人脸识别系统--C++实现
20 6
|
17天前
|
Ubuntu 架构师 Java
Linux系统常用命令非常详细建议收藏
Linux系统常用命令非常详细建议收藏
48 0
|
23天前
|
存储 算法 Linux
【Linux系统编程】Linux 文件系统探究:深入理解 struct dirent、DIR 和 struct stat结构
【Linux系统编程】Linux 文件系统探究:深入理解 struct dirent、DIR 和 struct stat结构
36 0
|
2天前
|
运维 网络协议 Unix
18.系统知识-Linux常用命令
18.系统知识-Linux常用命令
|
11天前
|
Prometheus 监控 Cloud Native
【Linux】查看系统内存命令(详细讲解)
【Linux】查看系统内存命令(详细讲解)