可以通过以下代码,获取所有的错误码信息:

#include <string.h> /* for strerror */
#include <errno.h>
#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;
}

编译此程序用命令:

gcc -Wall strerror.c

执行程序:

./a.out

输出如下:

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

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 secion 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

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

c语言所有的errno枚举值含义的更多相关文章

  1. JAVA中自定义扩展Swagger的能力,自动生成参数取值含义说明,提升开发效率

    大家好,又见面了. 在JAVA做前后端分离的项目开发的时候,服务端需要提供接口文档供周边人员做接口的对接指导.越来越多的项目都在尝试使用一些基于代码自动生成接口文档的工具来替代由开发人员手动编写接口文 ...

  2. .NET陷阱之六:从枚举值持久化带来大量空间消耗谈起

    好长时间没有写博文了,今天继续. 这次跟大家分享的内容起因于对一个枚举值列表的序列化,下面简化后的代码即能重现.为了明确起见,我显式指定了枚举的基础类型. // 定义一个枚举类型. public en ...

  3. ZeroMQ接口函数之 :zmq_errno – 返回errno的值给调用此函数的线程

    ZeroMQ 官方地址 :http://api.zeromq.org/4-0:zmq_errno zmq_errno(3)         ØMQ Manual - ØMQ/3.2.5 Name zm ...

  4. AX2012 multiple enum values as query filter选择多个枚举值当过滤条件

    classDeclaration { QueryBuildRange qbrLocationType; } datasource.init() { super(); qbrLocationType = ...

  5. 获取枚举值上的Description特性说明

    /// <summary> /// 获取枚举值上的Description特性说明 /// </summary> /// <typeparam name="T&q ...

  6. C#八皇后问题 枚举值

    记得刚出道的时候, 有考虑怎么面试, 以及可能会遇到的面试题, 有一个人说了一下 八皇后问题, 据说要用 sql 语句写出来, 暂时我 写了一个C#版本的, 经测验,八皇后算法结果为 92种, 这个与 ...

  7. MVC3不能正确识别JSON中的Enum枚举值

    一.背景 在MVC3项目里,如果Action的参数中有Enum枚举作为对象属性的话,使用POST方法提交过来的JSON数据中的枚举值却无法正确被识别对应的枚举值. 二.Demo演示 为了说明问题,我使 ...

  8. 在C#中如何读取枚举值的描述属性

    在C#中,有时候我们需要读取枚举值的描述属性,也就是说这个枚举值代表了什么意思.比如本文中枚举值 Chinese ,我们希望知道它代表意思的说明(即“中文”). 有下面的枚举: 1 2 3 4 5 6 ...

  9. 利用DescriptionAttribute定义枚举值的描述信息 z

    System.ComponentModel命名空间下有个名为DescriptionAttribute的类用于指定属性或事件的说明,我所调用的枚举值描述信息就是DescriptionAttribute类 ...

随机推荐

  1. laravel3中文文档是迈入laravel4的捷径

    http://v3.golaravel.com/docs/ 目录 Laravel概览 更新日志 安装与设置 系统需求 安装 服务器设置 基本设置 环境 友好的链接(URL) 路由 基础 通配符(Wil ...

  2. MVC4 成员资格、 身份验证

    SimpleMembership,成员资格提供程序. 通用的提供者和新的 ASP.NET 4.5 Web 窗体和 ASP.NET MVC 4 模板 ASP.NET MVC 4 互联网模板中添加一些新的 ...

  3. eclipse注释模板修改

    http://swiftlet.net/archives/1199 以下为模板文件 <?xml version="1.0" encoding="UTF-8" ...

  4. 给linux设置grub密码

    一.明文加密:vim /etc/grub.conf在hiddemenu下面新增一行,输入:password 密文然后:wq保存退出 在开机出现退数菜单的时候,按任意键,就会出现启动选择菜单,这时下面的 ...

  5. Curl命令使用方法

    Curl是Linux下一个很强大的http命令行工具,其功能十分强大.1) 读取网页$ curl http://www.linuxidc.com2) 保存网页$ curl http://www.lin ...

  6. (转)IIS7 下部署Asp.net应用

    最近在部署一个ASP.NET的应用到IIS7中的时候,遇到了一些问题,现在把部署中的遇到的问题和部署步骤进行总结一下,本文中只涉及到ASP.NET的基本部署. 一.    部署环境 Windows 7 ...

  7. 分享一个通用的分页SQL

    又很久没写博客,今天记录一个SQLserver通用分页存储过程(适用于SqlServer2000及以上版本) 1.支持连表 2.支持条件查询 USE [MYDB] GO /****** Object: ...

  8. 数据库分库分表(sharding)系列(一)拆分实施策略和示例演示

    本文原文连接: http://blog.csdn.net/bluishglc/article/details/7696085 ,转载请注明出处!本文着重介绍sharding切分策略,如果你对数据库sh ...

  9. arry()数组的理解及api的使用(一)

    我们想要了解数组,首先就要先要了解到什么是数据结构,所谓的数据结构就是把数据与数据见的关系按照特定的结构来保存.设计合理的数据结构是解决问题的前提.了解了数据结构后我们下面来数组的定义:数组(arra ...

  10. C++读取一串不知个数的数字

    #include <iostream> using namespace std; int main(){ ]; ; while(cin>>shuzu[i]){ i++; } ; ...