Linux下最常见的就是errno了,一般当发生错误时便会给全局变量errno赋值,其所有可能的值可查看linux的库文件,以下是查看linux v3.0的结果:

/usr/include/asm-generic/errno-base.h

[cpp] view plaincopyprint?

#ifndef _ASM_GENERIC_ERRNO_BASE_H

#define _ASM_GENERIC_ERRNO_BASE_H

#define EPERM 1 /* Operation not permitted */

#define ENOENT 2 /* 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 ENOEXEC 8 /* Exec format error */

#define EBADF 9 /* Bad file number */

#define ECHILD 10 /* No child processes */

#define EAGAIN 11 /* Try again */

#define ENOMEM 12 /* Out of memory */

#define EACCES 13 /* Permission denied */

#define EFAULT 14 /* Bad address */

#define ENOTBLK 15 /* Block device required */

#define EBUSY 16 /* Device or resource busy */

#define EEXIST 17 /* File exists */

#define EXDEV 18 /* Cross-device link */

#define ENODEV 19 /* No such device */

#define ENOTDIR 20 /* Not a directory */

#define EISDIR 21 /* Is a directory */

#define EINVAL 22 /* Invalid argument */

#define ENFILE 23 /* File table overflow */

#define EMFILE 24 /* Too many open files */

#define ENOTTY 25 /* Not a typewriter */

#define ETXTBSY 26 /* Text file busy */

#define EFBIG 27 /* File too large */

#define ENOSPC 28 /* No space left on device */

#define ESPIPE 29 /* Illegal seek */

#define EROFS 30 /* Read-only file system */

#define EMLINK 31 /* Too many links */

#define EPIPE 32 /* Broken pipe */

#define EDOM 33 /* Math argument out of domain of func */

#define ERANGE 34 /* Math result not representable */

#endif

/usr/include/asm-generic/errno.h

#ifndef _ASM_GENERIC_ERRNO_H

#define _ASM_GENERIC_ERRNO_H

#include

#define EDEADLK 35 /* Resource deadlock would occur */

#define ENAMETOOLONG 36 /* File name too long */

#define ENOLCK 37 /* No record locks available */

#define ENOSYS 38 /* Function not implemented */

#define ENOTEMPTY 39 /* Directory not empty */

#define ELOOP 40 /* Too many symbolic links encountered */

#define EWOULDBLOCK EAGAIN /* Operation would block */

#define ENOMSG 42 /* No message of desired type */

#define EIDRM 43 /* Identifier removed */

#define ECHRNG 44 /* Channel number out of range */

#define EL2NSYNC 45 /* Level 2 not synchronized */

#define EL3HLT 46 /* Level 3 halted */

#define EL3RST 47 /* Level 3 reset */

#define ELNRNG 48 /* Link number out of range */

#define EUNATCH 49 /* Protocol driver not attached */

#define ENOCSI 50 /* No CSI structure available */

#define EL2HLT 51 /* Level 2 halted */

#define EBADE 52 /* Invalid exchange */

#define EBADR 53 /* Invalid request descriptor */

#define EXFULL 54 /* Exchange full */

#define ENOANO 55 /* No anode */

#define EBADRQC 56 /* Invalid request code */

#define EBADSLT 57 /* Invalid slot */

#define EDEADLOCK EDEADLK

#define EBFONT 59 /* Bad font file format */

#define ENOSTR 60 /* Device not a stream */

#define ENODATA 61 /* No data available */

#define ETIME 62 /* Timer expired */

#define ENOSR 63 /* Out of streams resources */

#define ENONET 64 /* Machine is not on the network */

#define ENOPKG 65 /* Package not installed */

#define EREMOTE 66 /* Object is remote */

#define ENOLINK 67 /* Link has been severed */

#define EADV 68 /* Advertise error */

#define ESRMNT 69 /* Srmount error */

#define ECOMM 70 /* Communication error on send */

#define EPROTO 71 /* Protocol error */

#define EMULTIHOP 72 /* Multihop attempted */

#define EDOTDOT 73 /* RFS specific error */

#define EBADMSG 74 /* Not a data message */

#define EOVERFLOW 75 /* Value too large for defined data type */

#define ENOTUNIQ 76 /* Name not unique on network */

#define EBADFD 77 /* File descriptor in bad state */

#define EREMCHG 78 /* Remote address changed */

#define ELIBACC 79 /* Can not access a needed shared library */

#define ELIBBAD 80 /* Accessing a corrupted shared library */

#define ELIBSCN 81 /* .lib section in a.out corrupted */

#define ELIBMAX 82 /* Attempting to link in too many shared libraries */

#define ELIBEXEC 83 /* Cannot exec a shared library directly */

#define EILSEQ 84 /* Illegal byte sequence */

#define ERESTART 85 /* Interrupted system call should be restarted */

#define ESTRPIPE 86 /* Streams pipe error */

#define EUSERS 87 /* Too many users */

#define ENOTSOCK 88 /* Socket operation on non-socket */

#define EDESTADDRREQ 89 /* Destination address required */

#define EMSGSIZE 90 /* Message too long */

#define EPROTOTYPE 91 /* Protocol wrong type for socket */

#define ENOPROTOOPT 92 /* Protocol not available */

#define EPROTONOSUPPORT 93 /* Protocol not supported */

#define ESOCKTNOSUPPORT 94 /* Socket type not supported */

#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */

#define EPFNOSUPPORT 96 /* Protocol family not supported */

#define EAFNOSUPPORT 97 /* Address family not supported by protocol */

#define EADDRINUSE 98 /* Address already in use */

#define EADDRNOTAVAIL 99 /* Cannot assign requested address */

#define ENETDOWN 100 /* Network is down */

#define ENETUNREACH 101 /* Network is unreachable */

#define ENETRESET 102 /* Network dropped connection because of reset */

#define ECONNABORTED 103 /* Software caused connection abort */

#define ECONNRESET 104 /* Connection reset by peer */

#define ENOBUFS 105 /* No buffer space available */

#define EISCONN 106 /* Transport endpoint is already connected */

#define ENOTCONN 107 /* Transport endpoint is not connected */

#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */

#define ETOOMANYREFS 109 /* Too many references: cannot splice */

#define ETIMEDOUT 110 /* Connection timed out */

#define ECONNREFUSED 111 /* Connection refused */

#define EHOSTDOWN 112 /* Host is down */

#define EHOSTUNREACH 113 /* No route to host */

#define EALREADY 114 /* Operation already in progress */

#define EINPROGRESS 115 /* Operation now in progress */

#define ESTALE 116 /* Stale NFS file handle */

#define EUCLEAN 117 /* Structure needs cleaning */

#define ENOTNAM 118 /* Not a XENIX named type file */

#define ENAVAIL 119 /* No XENIX semaphores available */

#define EISNAM 120 /* Is a named type file */

#define EREMOTEIO 121 /* Remote I/O error */

#define EDQUOT 122 /* Quota exceeded */

#define ENOMEDIUM 123 /* No medium found */

#define EMEDIUMTYPE 124 /* Wrong medium type */

#define ECANCELED 125 /* Operation Canceled */

#define ENOKEY 126 /* Required key not available */

#define EKEYEXPIRED 127 /* Key has expired */

#define EKEYREVOKED 128 /* Key has been revoked */

#define EKEYREJECTED 129 /* Key was rejected by service */

/* for robust mutexes */

#define EOWNERDEAD 130 /* Owner died */

#define ENOTRECOVERABLE 131 /* State not recoverable */

#endif

linux全局变量=多个值,linux errno全局变量各值含义相关推荐

  1. 深刻理解linux进程间通信 pdf,深刻理解Linux进程间通信.doc

    深刻理解Linux进程间通信.doc 深刻理解 Linux 进程间通信(IPC)级别 初级 郑彦兴 国防科大计算机学院 2002 年 12 月 11 日 一个大型的应用系统,往往需要众多进程协作,进程 ...

  2. c++全局变量怎么定义_C errno全局变量是否是线程安全的

    在使用多线程时,遇到了一个问题:线程例程中如果需要使用errno全局变量,如何保证errno的线程安全性?例如一个简单的线程池代码: for(int i=0;i<THREADNUM;i++){p ...

  3. linux 变量函数返回值,linux shell 自定义函数(定义、返回值、变量作用域)介绍...

    linux shell 可以用户定义函数,然后在shell脚本中可以随便调用.下面说说它的定义方法,以及调用需要注意那些事项. 一.定义shell函数(define function) 语法: [ f ...

  4. open函数和errno全局变量

    (1)open函数 man man   查看man文档的首页  其中DESCRIPTION部分描述了man文档的每一章的章节内容 第2章System calls为系统调用,即Liunx系统函数. ma ...

  5. 全局变量-函数内部不允许修改局部变量的值

    # 全局变量 num = 10def demo1():# 希望修改全局变量的值# 在 python 中,是不允许直接修改全局变量的值# 如果使用赋值语句,会在函数内部,定义一个局部变量num = 99 ...

  6. linux 查看文件哈希码,使用linux的sha1sum命令查看效验文件哈希值命令

    服务器 今天小编给大家分享的是使用linux的sha1sum命令查看效验文件哈希值命令,相信很多人都不太了解,为了让大家更加了解,所以给大家总结了以下内容,一起往下看吧.一定会有所收获的哦. sha1 ...

  7. 【linux】进程优先级、nice系统中的nice值和nice time,top中的PR和ps中的PRI

    出处:https://blog.csdn.net/u010317005/article/details/80531985 linux内核目前实现了6中调度策略(即调度算法), 用于对不同类型的进程进行 ...

  8. 【Python】全局变量详解二(修改全局变量值、定义位置和代码结构、命名建议)

    全局变量是在函数外部定义的变量(没有定义在某一个函数内),所有函数内部都可以使用这个变量. 提示:全局变量是可变的,在其他开发语言中,大多是不推荐使用全局变量的,因为可变范围太大,会导致程序后期不好维 ...

  9. 关于Ajax回调函数内返回值无法给全局变量赋值的问题

    众所周知,Ajax从后端获得数据到回调函数,想要将获取的值赋给全局变量的话要将Ajax中的async改为false,使其同步,不然js在按顺序执行时等请求发出后就先去执行Ajax下面的代码了. var ...

最新文章

  1. 搜索引擎的两大问题(2) - 相关性
  2. C++程序员必读的经典著作
  3. 概率论-2.7 分布的其他特征函数
  4. 垃圾分类毕设java程序_垃圾“拍一拍”,分类不用愁!生活垃圾分类查询小程序上线啦...
  5. mysql写入 cpu飙升_分析MySQL中索引引引发的CPU负载飙升的问题
  6. 15. 二进制中1的个数
  7. bug记录:虚拟机ping不通外网
  8. Android:通过Intent传递对象、Parcelable
  9. Web 开发与设计师速查手册大全
  10. 双管理人模式下的契约型私募基金实用发行指南
  11. CMS网站页面管理开发汇总
  12. 枫叶股票监控免费软件 股票基金涨幅盈亏监控 上班摸鱼炒股神器
  13. 思科网技术学院教程(第三、四学期第二版)学习笔记与要点归纳
  14. 手机uc7.2java版下载_UC浏览器 JAVA
  15. 机器学习之理解支持向量机SVM
  16. Exception raised: Traceback (most recent call last):
  17. (原创)微信公众号开发的简单模板及配置流程简介
  18. iptables 跨网段转发
  19. Android基础面试题
  20. 【机器学习】手写数字识别学习笔记(对三篇文件进行分析记录)

热门文章

  1. evcdf matlab,求助大神
  2. std string与线程安全_详解linux系统中断线程的那些事
  3. Java中switch都可以支持哪些数据类型
  4. 查找内存泄漏的一个思路
  5. joyui版本和android版本,游戏爱好者注意!JOYUI 11来了
  6. oracle x6-2能装2008吗,Sun服务器电源Oracle Server X6-2原装拆机7079395 600 AC
  7. 大智慧数据文件python_Python 自动化测试(四):数据驱动
  8. opencv 图像识别 e语言_openCV-特征点匹配算法介绍一:理解特征
  9. python函数名的语法_Python 基础语法六 ——函数
  10. cmyk图像处理matlab,数字图像处理及MATLAB实现 全套课件.pptx