strerror(errno):获取errno对应的错误

查看错误代码errno是调试程序的一个重要方法。当linux C api函数发生异常时,一般会将errno变量(需include errno.h)赋一个整数值,不同的值表示不同的含义,可以通过查看该值推测出错的原因。在实际编程中用这一招解决了不少原本看来莫名其妙的问题。比较 麻烦的是每次都要去linux源代码里面查找错误代码的含义,现在把它贴出来,以后需要查时就来这里看了。

errno. is: Success
errno. is: Operation not permitted
errno. is: No such file or directory
errno. is: No such process
errno. is: Interrupted system call
errno. is: Input/output error
errno. is: No such device or address
errno. is: Argument list too long
errno. is: Exec format error
errno. is: Bad file descriptor
errno. is: No child processes
errno. is: Resource temporarily unavailable[资源临时不可用](连续发送数据时候回出此错,加延时)
errno. is: Cannot allocate memory
errno. is: Permission denied
errno. is: Bad address
errno. is: Block device required
errno. is: Device or resource busy
errno. is: File exists
errno. is: Invalid cross-device link
errno. is: No such device
errno. is: Not a directory
errno. is: Is a directory
errno. is: Invalid argument
errno. is: Too many open files in system
errno. is: Too many open files
errno. is: Inappropriate ioctl for device
errno. is: Text file busy
errno. is: File too large
errno. is: No space left on device
errno. is: Illegal seek
errno. is: Read-only file system
errno. is: Too many links
errno. is: Broken pipe[断开的管道](原因:the broken pipe error occurs if one end of the
TCP socket closes connection(using disconnect) or gets killed and the other
end tries to still write to it. An indication of a closed/terminated
connection is a return value of when you try to read from that socket
using recv. After receiving such an error, if you try to still write to the
socket, your process gets sent the SIGPIPE signal which kills it.
)
errno. is: Numerical argument out of domain
errno. is: Numerical result out of range
errno. is: Resource deadlock avoided
errno. is: File name too long
errno. is: No locks available
errno. is: Function not implemented
errno. is: Directory not empty
errno. is: Too many levels of symbolic links
errno. is: Unknown error
errno. is: No message of desired type
errno. is: Identifier removed
errno. is: Channel number out of range
errno. is: Level not synchronized
errno. is: Level halted
errno. is: Level reset
errno. is: Link number out of range
errno. is: Protocol driver not attached
errno. is: No CSI structure available
errno. is: Level halted
errno. is: Invalid exchange
errno. is: Invalid request descriptor
errno. is: Exchange full
errno. is: No anode
errno. is: Invalid request code
errno. is: Invalid slot
errno. is: Unknown error
errno. is: Bad font file format
errno. is: Device not a stream
errno. is: No data available
errno. is: Timer expired
errno. is: Out of streams resources
errno. is: Machine is not on the network
errno. is: Package not installed
errno. is: Object is remote
errno. is: Link has been severed
errno. is: Advertise error
errno. is: Srmount error
errno. is: Communication error on send
errno. is: Protocol error
errno. is: Multihop attempted
errno. is: RFS specific error
errno. is: Bad message
errno. is: Value too large for defined data type
errno. is: Name not unique on network
errno. is: File descriptor in bad state
errno. is: Remote address changed
errno. is: Can not access a needed shared library
errno. is: Accessing a corrupted shared library
errno. is: .lib section in a.out corrupted
errno. is: Attempting to link in too many shared libraries
errno. is: Cannot exec a shared library directly
errno. is: Invalid or incomplete multibyte or wide character
errno. is: Interrupted system call should be restarted
errno. is: Streams pipe error
errno. is: Too many users
errno. is: Socket operation on non-socket
errno. is: Destination address required
errno. is: Message too long
errno. is: Protocol wrong type for socket
errno. is: Protocol not available
errno. is: Protocol not supported
errno. is: Socket type not supported
errno. is: Operation not supported
errno. is: Protocol family not supported
errno. is: Address family not supported by protocol
errno. is: Address already in use
errno. is: Cannot assign requested address
errno. is: Network is down
errno. is: Network is unreachable
errno. is: Network dropped connection on reset
errno. is: Software caused connection abort
errno. is: Connection reset by peer[l连接被对端重置]
errno. is: No buffer space available
errno. is: Transport endpoint is already connected
errno. is: Transport endpoint is not connected
errno. is: Cannot send after transport endpoint shutdown
errno. is: Too many references: cannot splice
errno. is: Connection timed out
errno. is: Connection refused
errno. is: Host is down
errno. is: No route to host
errno. is: Operation already in progress
errno. is: Operation now in progress
errno. is: Stale NFS file handle
errno. is: Structure needs cleaning
errno. is: Not a XENIX named type file
errno. is: No XENIX semaphores available
errno. is: Is a named type file
errno. is: Remote I/O error
errno. is: Disk quota exceeded
errno. is: No medium found
errno. is: Wrong medium type
errno. is: Operation canceled
errno. is: Required key not available
errno. is: Key has expired
errno. is: Key has been revoked
errno. is: Key was rejected by service
errno. is: Owner died
errno. is: State not recoverable
errno. is: Unknown error
- 全是Unknown error

linux 下errno各个值的意义(转) errno.h的更多相关文章

  1. linux下各种颜色文件的意义

    linux下的文件颜色的意义 蓝色表示目录;绿色表示可执行文件;红色表示压缩文件;浅蓝色表示链接文件;灰色表示其它文件;红色闪烁表示链接的文件有问题了;黄色是设备文件,包括block, char, f ...

  2. Linux使用技巧:linux下将命令值赋给shell变量

    很多小伙伴在写shell脚本的时候需要把命令输出的值赋给一些变量,使得脚本在运行过程中能够顺利使用这些变量.例如:很多时候我们就需要获取当前目录的绝对路径,pwd这个命令大家在熟悉不过,可是要把这个命 ...

  3. Linux下不同文件不同颜色的意义

    通常,我们使用ls查看文件时,会出现不同颜色的文件,今天我就大概写一下不同颜色的代表意义: 蓝色————目录: 绿色————可执行文件: 红色————压缩文件: 浅蓝色————链接文件: 紫红色——— ...

  4. linux下编译时遇到fatal error: openssl/sha.h: No such file or directory怎么办?

    答:安装ssl开发库 ubuntu下的安装方法为: sudo apt-get install libssl-dev -y

  5. 转:socket编程在windows和linux下的区别

    如无其它说明,本文所指Linux均表示2.6内核Linux,GCC编译器,Windows均表示Windows XP系统,Visual Studio 2005 sp1编译环境. 下面大概分几个方面进行罗 ...

  6. socket编程在windows和linux下的区别

    如无其它说明,本文所指Linux均表示2.6内核Linux,GCC编译器,Windows均表示Windows XP系统,Visual Studio 2005 sp1编译环境. 下面大概分几个方面进行罗 ...

  7. Linux下时间格式转换及获取方法

    Linux下使用clock_gettime给程序计时 #include <stdio.h> #include <unistd.h> #include <stdlib.h& ...

  8. Windows下计算md5值

    目录 Windows下计算md5值 1.linux 下计算md5值 2.Windows下计算md5值 Windows下计算md5值 1.linux 下计算md5值 [root@master yl]# ...

  9. 在windows 、linux下读取目录下所有文件名

    Windows要引入的头文件是<Windows.h> 主要是两个函数FindFirstFile.FindNextFile MSDN里是这么说的: FindFirstFile functio ...

随机推荐

  1. python多进程生成缩略图

    在img目录下7张图片 分别是 11.jpg 22.jpg 33.jpg 44.jpg 55.jpg 66.jpg 77.jpg #encoding=utf-8 import os import ti ...

  2. spring-web中的WebDataBinder理解

    Spring可以自动封装Bean,也就是说前台通过SpringMVC传递过来的属性值会自动对应到对象中的属性并封装成javaBean,但是只能是基本数据类型(int,String等).如果传递过来的是 ...

  3. java sqlite配置和自定义函数

    资源 jetty Jetty Downloads地址 sqlite sqlite JDBC Driver 地址:bitbucket代码托管 和 Github代码托管 jetty配置sqlite 在je ...

  4. HTML5 2D平台游戏开发#4状态机

    在实现了<HTML5 2D平台游戏开发——角色动作篇之冲刺>之后,我发现随着角色动作的增加,代码中的逻辑判断越来越多,铺天盖地的if() else()语句实在让我捉襟见肘: 这还仅仅是角色 ...

  5. 新装上线 年度精品 XP,32/64位Win7,32/64位Win10系统【电脑城版】

    随着Windows 10Build 10074 Insider Preview版发布,有理由相信,Win10离最终RTM阶段已经不远了.看来稍早前传闻的合作伙伴透露微软将在7月底正式发布Win10的消 ...

  6. visual C++ & Makefile

    Makefile说明: visual c++ 不通过IDE有3中方式对工程进行编译链接. 1.MSBuild 编译链接(IDE就是使用MSBuild,需要工程的.vcxproj和.filters文件) ...

  7. webstorm vscode 常用设置

    webstorm常用的设置及操作图解 VS Code 新建vue文件初始化模板 VSCode新建vue文件自定义模板

  8. VS中Component Class、User Control及Custom Control的区别 .

    .NET Framework 为您提供了开发和实现新控件的能力.除了常见的用户控件外,现在您会发现,您可以编写能执行自身绘图的自定义控件,甚至还可以通过继承扩展现有控件的功能.确定创建何种类型的控件可 ...

  9. 【BZOJ1097】[POI2007]旅游景点atr 最短路+状压DP

    [BZOJ1097][POI2007]旅游景点atr Description FGD想从成都去上海旅游.在旅途中他希望经过一些城市并在那里欣赏风景,品尝风味小吃或者做其他的有趣的事情.经过这些城市的顺 ...

  10. href=http:// href=// 的区别,src=http:// src=// 的区别。 链接里不带http,链接里直接使用双斜线 // 有什么不同。http://和//有什么区别?

    其实很简单,当一个连接用双斜线 // 开头时表示如果浏览器当前使用的是https协议,那么就加载https协议的脚本,否则使用http,这保证了页面所有资源使用同一协议. 其实是有人将其做为规范来实践 ...