linux 下各errno的意义(转)

 

本文转自:http://blog.csdn.net/kofiory/article/details/5790409

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

/****************************获取错误代码描述**************/

#include <string.h>
#include <errno.h>  /* for strerror */
#include <stdio.h>

int main(int argc, char ** argv)
{
  int i = 0;
  for(i = 0; i < 256; i++)
  printf("errno.%02d is: %s/n", i, strerror(i));
  return 0;
}

/*****************************************************************/

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

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

  1. linux 下各errno的意义

    strerror(errno):获取errno对应的错误 #include <string.h> /* for strerror */ #include <errno.h> # ...

  2. linux 下信号处理命令trap && linux下各种信号的意义

    1.用途说明 trap是一个shell内建命令,它用来在脚本中指定信号如何处理.比如,按Ctrl+C会使脚本终止执行,实际上系统发送了SIGINT信号给脚本进程,SIGINT信号的默认处理方式就是退出 ...

  3. linux下错误的捕获:errno(errno.h)和strerror(string.h)的使用

    参考:http://blog.csdn.net/starstar1992/article/details/52756387 linux下错误的捕获:errno和strerror的使用 经常在调用lin ...

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

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

  5. Linux下文件的三个时间意义及用法

    Linux下文件的三个时间参数: (1)modification time(mtime):内容修改时间        这里的修改时间指的是文件的内容发生变化,而更新的时间. (2)change tim ...

  6. Linux下c开发 之 线程通信(转)

    Linux下c开发 之 线程通信(转) 1.Linux“线程” 进程与线程之间是有区别的,不过Linux内核只提供了轻量进程的支持,未实现线程模型.Linux是一种“多进程单线程”的操作系统.Linu ...

  7. Linux下的C编程实战

    Linux下的C编程实战(一) ――开发平台搭建 1.引言 Linux操作系统在服务器领域的应用和普及已经有较长的历史,这源于它的开源特点以及其超越Windows的安全性和稳定性.而近年来, Linu ...

  8. Linux下串口编制【转】

    串行口是计算机一种常用的接口,具有连接线少,通讯简单,得到广泛的使用.常用的串口是RS-232-C接口(又称EIA RS-232-C)它是在1970年由美国电子工业协会(EIA)联合贝尔系统.调制解调 ...

  9. linux下的struct sigaction

    工作中使用案例: struct sigaction act; act.sa_sigaction = handleSignal; act.sa_flags = SA_SIGINFO; sigemptys ...

随机推荐

  1. HGOI 20191029am 题解

    Promblem A 小G的字符串 给定$n,k$,构造一个长度为$n$,只能使用$k$种小写字母的字符串. 要求相邻字符不能相同且$k$种字母都要出现 输出字典序最小的字符串,无解输出$-1$. 对 ...

  2. svn的下载与安装,使用,包教包会!!!

    svn的安装使用说明 下载svn服务器与搭建 高效开发 — SVN使用教程(客户端与服务端安装详解!带图!带注释!安装客户端与服务端的地址可以看上两个链接) svn安装分为两部分,服务端安装与客户端安 ...

  3. Spring——顾问封装通知

    通知(advice)是Spring中的一种比较简单的切面,只能将切面织入到目标类的所有方法中,而无法对指定方法进行增强 顾问(advisor)是Spring提供的另外一种切面,可以织入到指定的方法中  ...

  4. phpstorm 比较修改过的代码 version control

  5. WebSocket-java实现

    一.所需jar 二.创建websocket.jsp(注意此页面链接,需要链接到自己的服务) <%@ page language="java" import="jav ...

  6. android data binding jetpack III 绑定一个方法

    第三篇 给view绑定一下方法响应. (补充:1.被绑定的方法必须是public的.   1.绑定方法可以用主语法.也可以用以下双冒号方式“::” android:onClick="@{pr ...

  7. 让SpringBoot工程支持热部署

    下载地址:https://files.cnblogs.com/files/xiandedanteng/SpringBootWeb-1_20190928.rar 修改Java文件后,每次要重启才好用,修 ...

  8. 没有安装zip引发的一系列安装

    安装一个php框架的时候提示不能在线解压缩 通过phpinfo查看没有加载zip扩展,安装开始. 先安装了一次发现不能make,,,什么情况!!! 提示这个错误,好吧解决.make: *** No t ...

  9. C#汉字转换拼音技术详解(高性能)

    public static class ChineseToPinYin { private static readonly Dictionary<<span class="key ...

  10. 堆的ptmalloc机制

    ptmalloc下堆的分配和回收 ptmalloc内存分配 1) 获取分配区的锁,为了防止多个线程同时访问同一个分配区,在进行分配之前需要取得分配区域的锁.线程先查看线程私有实例中是否已经存在一个分配 ...