linux 下各errno的意义
strerror(errno):获取errno对应的错误
- #include <string.h> /* for strerror */
- #include <errno.h>
- #include <stdio.h>
- int main(int argc, char ** argv) {
- int i = ;
- for(i = ; i < ; i++)
- printf("errno.%02d is: %s/n", i, strerror(i));
- return ;
- }
错误对照表:
- errno0 : Success
- errno1 : Operation not permitted
- errno2 : No such file or directory
- errno3 : No such process
- errno4 : Interrupted system call
- errno5 : Input/output error
- errno6 : No such device or address
- errno7 : Argument list too long
- errno8 : Exec format error
- errno9 : Bad file descriptor
- errno10 : No child processes
- errno11 : Resource temporarily unavailable
- errno12 : Cannot allocate memory
- errno13 : Permission denied
- errno14 : Bad address
- errno15 : Block device required
- errno16 : Device or resource busy
- errno17 : File exists
- errno18 : Invalid cross-device link
- errno19 : No such device
- errno20 : Not a directory
- errno21 : Is a directory
- errno22 : Invalid argument
- errno23 : Too many open files in system
- errno24 : Too many open files
- errno25 : Inappropriate ioctl for device
- errno26 : Text file busy
- errno27 : File too large
- errno28 : No space left on device
- errno29 : Illegal seek
- errno30 : Read-only file system
- errno31 : Too many links
- errno32 : Broken pipe
- errno33 : Numerical argument out of domain
- errno34 : Numerical result out of range
- errno35 : Resource deadlock avoided
- errno36 : File name too long
- errno37 : No locks available
- errno38 : Function not implemented
- errno39 : Directory not empty
- errno40 : Too many levels of symbolic links
- errno41 : Unknown error
- errno42 : No message of desired type
- errno43 : Identifier removed
- errno44 : Channel number out of range
- errno45 : Level not synchronized
- errno46 : Level halted
- errno47 : Level reset
- errno48 : Link number out of range
- errno49 : Protocol driver not attached
- errno50 : No CSI structure available
- errno51 : Level halted
- errno52 : Invalid exchange
- errno53 : Invalid request descriptor
- errno54 : Exchange full
- errno55 : No anode
- errno56 : Invalid request code
- errno57 : Invalid slot
- errno58 : Unknown error
- errno59 : Bad font file format
- errno60 : Device not a stream
- errno61 : No data available
- errno62 : Timer expired
- errno63 : Out of streams resources
- errno64 : Machine is not on the network
- errno65 : Package not installed
- errno66 : Object is remote
- errno67 : Link has been severed
- errno68 : Advertise error
- errno69 : Srmount error
- errno70 : Communication error on send
- errno71 : Protocol error
- errno72 : Multihop attempted
- errno73 : RFS specific error
- errno74 : Bad message
- errno75 : Value too large for defined datatype
- errno76 : Name not unique on network
- errno77 : File descriptor in bad state
- errno78 : Remote address changed
- errno79 : Can not access a needed sharedlibrary
- errno80 : Accessing a corrupted sharedlibrary
- errno81 : .lib section in a.out corrupted
- errno82 : Attempting to link in too manyshared libraries
- errno83 : Cannot exec a shared librarydirectly
- errno84 : Invalid or incomplete multibyte orwide character
- errno85 : Interrupted system call should berestarted
- errno86 : Streams pipe error
- errno87 : Too many users
- errno88 : Socket operation on non-socket
- errno89 : Destinationaddress required
- errno90 : Message too long
- errno91 : Protocol wrong type for socket
- errno92 : Protocol not available
- errno93 : Protocol not supported
- errno94 : Socket type not supported
- errno95 : Operation not supported
- errno96 : Protocol family not supported
- errno97 : Address family not supported byprotocol
- errno98 : Address already in use
- errno99 : Cannot assign requested address
- errno100 : Network is down
- errno101 : Network is unreachable
- errno102 : Network dropped connection onreset
- errno103 : Software caused connection abort
- errno104 : Connection reset by peer
- errno105 : No buffer space available
- errno106 : Transport endpoint is alreadyconnected
- errno107 : Transport endpoint is notconnected
- errno108 : Cannot send after transportendpoint shutdown
- errno109 : Too many references: cannot splice
- errno110 : Connection timed out
- errno111 : Connection refused
- errno112 : Host is down
- errno113 : No route to host
- errno114 : Operation already in progress
- errno115 : Operation now in progress
- errno116 : Stale NFS file handle
- errno117 : Structure needs cleaning
- errno118 : Not a XENIX named type file
- errno119 : No XENIX semaphores available
- errno120 : Is a named type file
- errno121 : Remote I/O error
- errno122 : Disk quota exceeded
- errno123 : No medium found
- errno124 : Wrong medium type
- errno125 : Operation canceled
- errno126 : Required key not available
- errno127 : Key has expired
- errno128 : Key has been revoked
- errno129 : Key was rejected by service
- errno130 : Owner died
- errno131 : State not recoverable
- errno132 : Operation not possible due toRF-kill
- errno133 : Unknown error
- errno134 : Unknown error
- errno135 : Unknown error
- errno136 : Unknown error
- errno137 : Unknown error
- errno138 : Unknown error
- errno139 : Unknown error
具体宏定义如下:
头文件 /usr/include/asm-generic/errno-base.h 的源码:
- #ifndef _ASM_GENERIC_ERRNO_BASE_H
- #define _ASM_GENERIC_ERRNO_BASE_H
- #define EPERM 1 /* Operation not permitted */
- #define ENOENT2 /* No such file or directory */
- #define ESRCH 3 /* No such process */
- #define EINTR 4 /* Interrupted system call */
- #define EIO 5 /* I/O error */
- #define ENXIO 6 /* No such device or address */
- #define E2BIG 7 /* Argument list too long */
- #define ENOEXEC8 /* Exec format error */
- #define EBADF 9 /* Bad file number */
- #define ECHILD10 /* No child processes */
- #define EAGAIN11 /* Try again */
- #define ENOMEM12 /* Out of memory */
- #define EACCES13 /* Permission denied */
- #define EFAULT14 /* Bad address */
- #define ENOTBLK15 /* Block device required */
- #define EBUSY 16 /* Device or resource busy */
- #define EEXIST17 /* File exists */
- #define EXDEV 18 /* Cross-device link */
- #define ENODEV19 /* No such device */
- #define ENOTDIR20 /* Not a directory */
- #define EISDIR21 /* Is a directory */
- #define EINVAL22 /* Invalid argument */
- #define ENFILE23 /* File table overflow */
- #define EMFILE24 /* Too many open files */
- #define ENOTTY25 /* Not a typewriter */
- #define ETXTBSY26 /* Text file busy */
- #define EFBIG 27 /* File too large */
- #define ENOSPC28 /* No space left on device */
- #define ESPIPE29 /* Illegal seek */
- #define EROFS 30 /* Read-only file system */
- #define EMLINK31 /* Too many links */
- #define EPIPE 32 /* Broken pipe */
- #define EDOM 33 /* Math argument out of domain of func */
- #define ERANGE34 /* Math result not representable */
- #endif
头文件/usr/include/asm-generic/erno.h源码:
- #ifndef _ASM_GENERIC_ERRNO_H
- #define _ASM_GENERIC_ERRNO_H
- #include <asm-generic/errno-base.h>
- #define EDEADLK35 /* Resource deadlock would occur */
- #define ENAMETOOLONG36 /* File name too long */
- #define ENOLCK37 /* No record locks available */
- #define ENOSYS38 /* Function not implemented */
- #define ENOTEMPTY39 /* Directory not empty */
- #define ELOOP 40 /* Too many symbolic links encountered */
- #define EWOULDBLOCKEAGAIN /* Operation would block */
- #define ENOMSG42 /* No message of desired type */
- #define EIDRM 43 /* Identifier removed */
- #define ECHRNG44 /* Channel number out of range */
- #define EL2NSYNC45 /* Level 2 not synchronized */
- #define EL3HLT46 /* Level 3 halted */
- #define EL3RST47 /* Level 3 reset */
- #define ELNRNG48 /* Link number out of range */
- #define EUNATCH49 /* Protocol driver not attached */
- #define ENOCSI50 /* No CSI structure available */
- #define EL2HLT51 /* Level 2 halted */
- #define EBADE 52 /* Invalid exchange */
- #define EBADR 53 /* Invalid request descriptor */
- #define EXFULL54 /* Exchange full */
- #define ENOANO55 /* No anode */
- #define EBADRQC56 /* Invalid request code */
- #define EBADSLT57 /* Invalid slot */
- #define EDEADLOCKEDEADLK
- #define EBFONT59 /* Bad font file format */
- #define ENOSTR60 /* Device not a stream */
- #define ENODATA61 /* No data available */
- #define ETIME 62 /* Timer expired */
- #define ENOSR 63 /* Out of streams resources */
- #define ENONET64 /* Machine is not on the network */
- #define ENOPKG65 /* Package not installed */
- #define EREMOTE66 /* Object is remote */
- #define ENOLINK67 /* Link has been severed */
- #define EADV 68 /* Advertise error */
- #define ESRMNT69 /* Srmount error */
- #define ECOMM 70 /* Communication error on send */
- #define EPROTO71 /* Protocol error */
- #define EMULTIHOP72 /* Multihop attempted */
- #define EDOTDOT73 /* RFS specific error */
- #define EBADMSG74 /* Not a data message */
- #define EOVERFLOW75 /* Value too large for defined data type */
- #define ENOTUNIQ76 /* Name not unique on network */
- #define EBADFD77 /* File descriptor in bad state */
- #define EREMCHG78 /* Remote address changed */
- #define ELIBACC79 /* Can not access a needed shared library */
- #define ELIBBAD80 /* Accessing a corrupted shared library */
- #define ELIBSCN81 /* .lib section in a.out corrupted */
- #define ELIBMAX82 /* Attempting to link in too many shared libraries */
- #define ELIBEXEC83 /* Cannot exec a shared library directly */
- #define EILSEQ84 /* Illegal byte sequence */
- #define ERESTART85 /* Interrupted system call should be restarted */
- #define ESTRPIPE86 /* Streams pipe error */
- #define EUSERS87 /* Too many users */
- #define ENOTSOCK88 /* Socket operation on non-socket */
- #define EDESTADDRREQ89 /* Destination address required */
- #define EMSGSIZE90 /* Message too long */
- #define EPROTOTYPE91 /* Protocol wrong type for socket */
- #define ENOPROTOOPT92 /* Protocol not available */
- #define EPROTONOSUPPORT93 /* Protocol not supported */
- #define ESOCKTNOSUPPORT94 /* Socket type not supported */
- #define EOPNOTSUPP95 /* Operation not supported on transport endpoint */
- #define EPFNOSUPPORT96 /* Protocol family not supported */
- #define EAFNOSUPPORT97 /* Address family not supported by protocol */
- #define EADDRINUSE98 /* Address already in use */
- #define EADDRNOTAVAIL99 /* Cannot assign requested address */
- #define ENETDOWN100 /* Network is down */
- #define ENETUNREACH101 /* Network is unreachable */
- #define ENETRESET102 /* Network dropped connection because of reset */
- #define ECONNABORTED103 /* Software caused connection abort */
- #define ECONNRESET104 /* Connection reset by peer */
- #define ENOBUFS105 /* No buffer space available */
- #define EISCONN106 /* Transport endpoint is already connected */
- #define ENOTCONN107 /* Transport endpoint is not connected */
- #define ESHUTDOWN108 /* Cannot send after transport endpoint shutdown */
- #define ETOOMANYREFS109 /* Too many references: cannot splice */
- #define ETIMEDOUT110 /* Connection timed out */
- #define ECONNREFUSED111 /* Connection refused */
- #define EHOSTDOWN112 /* Host is down */
- #define EHOSTUNREACH113 /* No route to host */
- #define EALREADY114 /* Operation already in progress */
- #define EINPROGRESS115 /* Operation now in progress */
- #define ESTALE116 /* Stale NFS file handle */
- #define EUCLEAN117 /* Structure needs cleaning */
- #define ENOTNAM118 /* Not a XENIX named type file */
- #define ENAVAIL119 /* No XENIX semaphores available */
- #define EISNAM120 /* Is a named type file */
- #define EREMOTEIO121 /* Remote I/O error */
- #define EDQUOT122 /* Quota exceeded */
- #define ENOMEDIUM123 /* No medium found */
- #define EMEDIUMTYPE124 /* Wrong medium type */
- #define ECANCELED125 /* Operation Canceled */
- #define ENOKEY126 /* Required key not available */
- #define EKEYEXPIRED127 /* Key has expired */
- #define EKEYREVOKED128 /* Key has been revoked */
- #define EKEYREJECTED129 /* Key was rejected by service */ /* for robust mutexes */ #define EOWNERDEAD130 /* Owner died */
- #define ENOTRECOVERABLE131 /* State not recoverable */
- #define ERFKILL 132/* Operation not possible due to RF-kill */
- #endif
linux 下各errno的意义的更多相关文章
- linux 下各errno的意义(转)
linux 下各errno的意义(转) 本文转自:http://blog.csdn.net/kofiory/article/details/5790409 strerror(errno):获取er ...
- linux 下信号处理命令trap && linux下各种信号的意义
1.用途说明 trap是一个shell内建命令,它用来在脚本中指定信号如何处理.比如,按Ctrl+C会使脚本终止执行,实际上系统发送了SIGINT信号给脚本进程,SIGINT信号的默认处理方式就是退出 ...
- linux下错误的捕获:errno(errno.h)和strerror(string.h)的使用
参考:http://blog.csdn.net/starstar1992/article/details/52756387 linux下错误的捕获:errno和strerror的使用 经常在调用lin ...
- linux下各种颜色文件的意义
linux下的文件颜色的意义 蓝色表示目录;绿色表示可执行文件;红色表示压缩文件;浅蓝色表示链接文件;灰色表示其它文件;红色闪烁表示链接的文件有问题了;黄色是设备文件,包括block, char, f ...
- Linux下文件的三个时间意义及用法
Linux下文件的三个时间参数: (1)modification time(mtime):内容修改时间 这里的修改时间指的是文件的内容发生变化,而更新的时间. (2)change tim ...
- Linux下c开发 之 线程通信(转)
Linux下c开发 之 线程通信(转) 1.Linux“线程” 进程与线程之间是有区别的,不过Linux内核只提供了轻量进程的支持,未实现线程模型.Linux是一种“多进程单线程”的操作系统.Linu ...
- Linux下的C编程实战
Linux下的C编程实战(一) ――开发平台搭建 1.引言 Linux操作系统在服务器领域的应用和普及已经有较长的历史,这源于它的开源特点以及其超越Windows的安全性和稳定性.而近年来, Linu ...
- Linux下串口编制【转】
串行口是计算机一种常用的接口,具有连接线少,通讯简单,得到广泛的使用.常用的串口是RS-232-C接口(又称EIA RS-232-C)它是在1970年由美国电子工业协会(EIA)联合贝尔系统.调制解调 ...
- linux下的struct sigaction
工作中使用案例: struct sigaction act; act.sa_sigaction = handleSignal; act.sa_flags = SA_SIGINFO; sigemptys ...
随机推荐
- Linux常用命令大全(2)
系统信息arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 - (SMBIOS / ...
- Laravel PHP Web开发框架
Laravel是一套简洁.优雅的PHP Web开发框架(PHP Web Framework).它可以让你从面条一样杂乱的代码中解脱出来:它可以帮你构建一个完美的网络APP,而且每行代码都可以简洁.富于 ...
- 使用PHP预定义变量得到url地址及相关参数
获取url地址栏参数多种方法:$_SERVER["SERVER_PORT"]//获取端口$_SERVER['HTTP_HOST']//获取域名或主机地址 如www.sina.com ...
- sphinx 简介以及安装 以及php拓展开启
一 sphinx 简介 在 使用mysql数据库过程中,如果想实现全文检索的优化,可以使用mysql自带全文索引,但是不支持中文..关于sphinx的安装网上很多教程写的都 不错比如:http:/ ...
- Day12 线程池、RabbitMQ和SQLAlchemy
1.with实现上下文管理 #!/usr/bin/env python# -*- coding: utf-8 -*-# Author: wanghuafeng #with实现上下文管理import c ...
- Python Tutorial 学习(四)--More Control Flow Tools
4.1 if 表达式 作为最为人熟知的if.你肯定对这样的一些表达式不感到陌生: >>> x = int(raw_input("Please enter an intege ...
- Inna and Sequence
Codeforces Round #220 (Div. 2) D:http://codeforces.com/contest/374/problem/D 题意:给你m个数,这m个数是递增的.然后给你n ...
- All in All
Crawling in process... Crawling failed Description You have devised a new encryption technique which ...
- xp下删除windows7,无法删除windows7文件夹,无法删除windows7文件,双系统卸载,取得文件权限
http://blog.csdn.net/lanmanck/article/details/5722050 ---------------------------------------------- ...
- 开启SQL Server 2012的远程连接
有个远程的SQL Server服务器需要连接,因为SQL server默认是把远程连接关闭的. 以下有文档,照着做了,但是还是连不上, http://www.2cto.com/database/201 ...