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. frame框架及其实例

    框架概念 : 谓框架便是网页画面分成几个框窗,同时取得多个 URL.只需要 <FRAMESET> <FRAME> 即可,面所有框架标记需要放在一个总起的 html 档,这个档案 ...

  2. npm常用命令(转)

    npm install <name>安装nodejs的依赖包 例如npm install express 就会默认安装express的最新版本,也可以通过在后面加版本号的方式安装指定版本, ...

  3. A和B是好友,他们经常在空闲时间聊天,A的空闲时间为[a1 ,b1 ],[a2 ,b2 ]..[ap ,bp ]。B的空闲时间是[c1 +t,d1 +t]..[cq +t,dq +t],这里t为B的起床时间。这些时间包括了边界点。B的起床时间为[l,r]的一个时刻。若一个起床时间能使两人在任意时刻聊天,那么这个时间就是合适的,问有多少个合适的起床时间?

    // ConsoleApplication5.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include<vector> ...

  4. difference between VM, Docker and Vagrant区别

    VM:  VirtualBox, VMware Docker Vagrant using which you can create VMs or container. It interacts wit ...

  5. 【BZOJ1786】[Ahoi2008]Pair 配对 DP

    [BZOJ1786][Ahoi2008]Pair 配对 Description Input Output Sample Input 5 4 4 2 -1 -1 3 Sample Output 4 题解 ...

  6. android菜鸟学习笔记13----Android控件(二) 自定义控件简单示例

    有时候,可能觉得系统提供的控件太丑,就会需要自定义控件来实现自己想要的效果. 以下主要参考<第一行代码> 1.自定义一个标题栏: 系统自带的标题栏很丑,且没什么大的作用,所以我们之前会在o ...

  7. 远程访问(HttpClient和HttpResponse的使用) 原型模式

    package com.webserver.webservice; import java.io.ByteArrayInputStream; import java.io.FileOutputStre ...

  8. 单例模式(Mongo对象的创建)

    单例模式: 饿汉式单例 //饿汉式单例类.在类初始化时,已经自行实例化 public class Singleton1 { //私有的默认构造子 private Singleton1() {} //已 ...

  9. iOS App打包上架超详细流程

    https://www.jianshu.com/p/817686897ec1?open_source=weibo_search

  10. UITableView的headerView和headerInsectionView

    UITableView有两个headerView:tableHeaderView.和headerInsectionView(组头视图).   给tableView添加这两个View:tableHead ...