Table of Contents

先看下cygwin的“sys/errno.h”文件

再看一下,signum对应的数值


先看下cygwin的“sys/errno.h”文件

/* errno is not a global variable, because that would make using itnon-reentrant.  Instead, its address is returned by the function__errno.  */#ifndef _SYS_ERRNO_H_
#ifdef __cplusplus
extern "C" {
#endif
#define _SYS_ERRNO_H_#include <sys/reent.h>#ifndef _REENT_ONLY
#define errno (*__errno())
extern int *__errno (void);
#endif/* Please don't use these variables directly.Use strerror instead. */
extern __IMPORT const char * const _sys_errlist[];
extern __IMPORT int _sys_nerr;
#ifdef __CYGWIN__
extern __IMPORT const char * const sys_errlist[];
extern __IMPORT int sys_nerr;
extern __IMPORT char *program_invocation_name;
extern __IMPORT char *program_invocation_short_name;
#endif#define __errno_r(ptr) ((ptr)->_errno)#define EPERM 1         /* Not owner */
#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         /* Arg list too long */
#define ENOEXEC 8       /* Exec format error */
#define EBADF 9         /* Bad file number */
#define ECHILD 10       /* No children */
#define EAGAIN 11       /* No more processes */
#define ENOMEM 12       /* Not enough space */
#define EACCES 13       /* Permission denied */
#define EFAULT 14       /* Bad address */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define ENOTBLK 15      /* Block device required */
#endif
#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       /* Too many open files in system */
#define EMFILE 24       /* File descriptor value too large */
#define ENOTTY 25       /* Not a character device */
#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         /* Mathematics argument out of domain of function */
#define ERANGE 34       /* Result too large */
#define ENOMSG 35       /* No message of desired type */
#define EIDRM 36        /* Identifier removed */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define ECHRNG 37       /* Channel number out of range */
#define EL2NSYNC 38     /* Level 2 not synchronized */
#define EL3HLT 39       /* Level 3 halted */
#define EL3RST 40       /* Level 3 reset */
#define ELNRNG 41       /* Link number out of range */
#define EUNATCH 42      /* Protocol driver not attached */
#define ENOCSI 43       /* No CSI structure available */
#define EL2HLT 44       /* Level 2 halted */
#endif
#define EDEADLK 45      /* Deadlock */
#define ENOLCK 46       /* No lock */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define EBADE 50        /* Invalid exchange */
#define EBADR 51        /* Invalid request descriptor */
#define EXFULL 52       /* Exchange full */
#define ENOANO 53       /* No anode */
#define EBADRQC 54      /* Invalid request code */
#define EBADSLT 55      /* Invalid slot */
#define EDEADLOCK 56    /* File locking deadlock error */
#define EBFONT 57       /* Bad font file fmt */
#endif
#define ENOSTR 60       /* Not a stream */
#define ENODATA 61      /* No data (for no delay io) */
#define ETIME 62        /* Stream ioctl timeout */
#define ENOSR 63        /* No stream resources */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define ENONET 64       /* Machine is not on the network */
#define ENOPKG 65       /* Package not installed */
#define EREMOTE 66      /* The object is remote */
#endif
#define ENOLINK 67      /* Virtual circuit is gone */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define EADV 68         /* Advertise error */
#define ESRMNT 69       /* Srmount error */
#define ECOMM 70        /* Communication error on send */
#endif
#define EPROTO 71       /* Protocol error */
#define EMULTIHOP 74    /* Multihop attempted */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define ELBIN 75        /* Inode is remote (not really error) */
#define EDOTDOT 76      /* Cross mount point (not really error) */
#endif
#define EBADMSG 77      /* Bad message */
#define EFTYPE 79       /* Inappropriate file type or format */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define ENOTUNIQ 80     /* Given log. name not unique */
#define EBADFD 81       /* f.d. invalid for this operation */
#define EREMCHG 82      /* Remote address changed */
#define ELIBACC 83      /* Can't access a needed shared lib */
#define ELIBBAD 84      /* Accessing a corrupted shared lib */
#define ELIBSCN 85      /* .lib section in a.out corrupted */
#define ELIBMAX 86      /* Attempting to link in too many libs */
#define ELIBEXEC 87     /* Attempting to exec a shared library */
#endif
#define ENOSYS 88       /* Function not implemented */
#ifdef __CYGWIN__
#define ENMFILE 89      /* No more files */
#endif
#define ENOTEMPTY 90    /* Directory not empty */
#define ENAMETOOLONG 91 /* File or path name too long */
#define ELOOP 92        /* Too many symbolic links */
#define EOPNOTSUPP 95   /* Operation not supported on socket */
#define EPFNOSUPPORT 96 /* Protocol family not supported */
#define ECONNRESET 104  /* Connection reset by peer */
#define ENOBUFS 105     /* No buffer space available */
#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */
#define EPROTOTYPE 107  /* Protocol wrong type for socket */
#define ENOTSOCK 108    /* Socket operation on non-socket */
#define ENOPROTOOPT 109 /* Protocol not available */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define ESHUTDOWN 110   /* Can't send after socket shutdown */
#endif
#define ECONNREFUSED 111        /* Connection refused */
#define EADDRINUSE 112          /* Address already in use */
#define ECONNABORTED 113        /* Software caused connection abort */
#define ENETUNREACH 114         /* Network is unreachable */
#define ENETDOWN 115            /* Network interface is not configured */
#define ETIMEDOUT 116           /* Connection timed out */
#define EHOSTDOWN 117           /* Host is down */
#define EHOSTUNREACH 118        /* Host is unreachable */
#define EINPROGRESS 119         /* Connection already in progress */
#define EALREADY 120            /* Socket already connected */
#define EDESTADDRREQ 121        /* Destination address required */
#define EMSGSIZE 122            /* Message too long */
#define EPROTONOSUPPORT 123     /* Unknown protocol */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define ESOCKTNOSUPPORT 124     /* Socket type not supported */
#endif
#define EADDRNOTAVAIL 125       /* Address not available */
#define ENETRESET 126           /* Connection aborted by network */
#define EISCONN 127             /* Socket is already connected */
#define ENOTCONN 128            /* Socket is not connected */
#define ETOOMANYREFS 129
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define EPROCLIM 130
#define EUSERS 131
#endif
#define EDQUOT 132
#define ESTALE 133
#define ENOTSUP 134             /* Not supported */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define ENOMEDIUM 135   /* No medium (in tape drive) */
#endif
#ifdef __CYGWIN__
#define ENOSHARE 136    /* No such host or network path */
#define ECASECLASH 137  /* Filename exists with different case */
#endif
#define EILSEQ 138              /* Illegal byte sequence */
#define EOVERFLOW 139   /* Value too large for defined data type */
#define ECANCELED 140   /* Operation canceled */
#define ENOTRECOVERABLE 141     /* State not recoverable */
#define EOWNERDEAD 142  /* Previous owner died */
#ifdef __LINUX_ERRNO_EXTENSIONS__
#define ESTRPIPE 143    /* Streams pipe error */
#endif
#define EWOULDBLOCK EAGAIN      /* Operation would block */#define __ELASTERROR 2000       /* Users can add values starting here */#ifdef __cplusplus
}
#endif
#endif /* _SYS_ERRNO_H */

再看一下,signum对应的数值

$ kill -l1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL       5) SIGTRAP6) SIGABRT      7) SIGEMT       8) SIGFPE       9) SIGKILL     10) SIGBUS
11) SIGSEGV     12) SIGSYS      13) SIGPIPE     14) SIGALRM     15) SIGTERM
16) SIGURG      17) SIGSTOP     18) SIGTSTP     19) SIGCONT     20) SIGCHLD
21) SIGTTIN     22) SIGTTOU     23) SIGIO       24) SIGXCPU     25) SIGXFSZ
26) SIGVTALRM   27) SIGPROF     28) SIGWINCH    29) SIGPWR      30) SIGUSR1
31) SIGUSR2     32) SIGRTMIN    33) SIGRTMIN+1  34) SIGRTMIN+2  35) SIGRTMIN+3
36) SIGRTMIN+4  37) SIGRTMIN+5  38) SIGRTMIN+6  39) SIGRTMIN+7  40) SIGRTMIN+8
41) SIGRTMIN+9  42) SIGRTMIN+10 43) SIGRTMIN+11 44) SIGRTMIN+12 45) SIGRTMIN+13
46) SIGRTMIN+14 47) SIGRTMIN+15 48) SIGRTMIN+16 49) SIGRTMAX-15 50) SIGRTMAX-14
51) SIGRTMAX-13 52) SIGRTMAX-12 53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9
56) SIGRTMAX-8  57) SIGRTMAX-7  58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4
61) SIGRTMAX-3  62) SIGRTMAX-2  63) SIGRTMAX-1  64) SIGRTMAX

自己体会

linux:errno与signum:错误码与信号相关推荐

  1. 【Linux应用编程】Linux编程中常见错误码含义及查询方式

    文章目录 1 前言 2 错误码查询 3 错误码翻译表 1 前言   linux应用程序开发过程中,经常会遇到一些错误信息的返回,存在的可能性有,参数有误.非法访问.系统资源限制.设备/文件不存在.访问 ...

  2. linux系统中socket错误码:EINTR和EAGAIN的处理

    目录 人为重启被中断的系统调用 安装信号时设置 SA_RESTART属性 忽略信号 永远阻塞的系统调用,被信号中断,导致其不继续等待,转而去执行signal_handler 1.什么是慢系统调用? 该 ...

  3. linux错误码61,Linux编程中的错误码列表

    有时可以知道错误的数值,但是如果不知道对应于那个宏定义,也很难知道这个错误描述的是什么.我平时这两种方法来确定:在内核源码中搜索和查看头文件. 在内核源码中搜索一般都可以搜到,而且使用source i ...

  4. linux qq 登录失败 错误码 -1,下载最新pidgin2.0.1源代码解决登录QQ提示密码错误

    相信现在大家很多人都开始用pidgin(gaim2)了,这个东西确实不错,但是该死的腾讯qq协议头变来变去,搞的linux下的im软件都上不了qq,前端时间pidgin还可以上的,现在也上不了了,还好 ...

  5. 【Linux系统编程】快速查找errno错误码信息

    我们都知道,errno整型变量被普遍应用于*NIX C的异常处理中,其记录了最近一次的错误码.通过判断错误码的值,以此执行不同的错误处理,这是C语言典型的异常处理方式.其错误名称,比如EAGAIN.E ...

  6. 网络编程中常见错误码总结

    在网络编程中,总有各种需要注意的环节,几乎每个API都要进行异常处理,判断返回值以及错误码来定位是否需要退出. 本文根据自身使用经验,总结以下错误码及其出现场景和一般处理流程. 网络编程的一般性流程如 ...

  7. error 系统错误 错误码10007_使用 Go 定义错误码

    简介 设计错误码 代码实现 常见的错误码 总结 当前部分的代码 简介 不管在什么系统中, 定义错误码都是必不可少的. 错误码可以帮助定义问题, 通常错误码设计为某种模式结构, 可以判断出错误的级别, ...

  8. 【Linux 】errno 错误码对照表和宏|error

    目录 错误对照表: 错误码对应宏 根据错误码打印错误信息 原文:Linux errno 错误对照表-https://blog.csdn.net/gpengtao/article/details/755 ...

  9. Linux常用错误码--errno-base.h

    经常会需要用到错误码,但是它具体的值 是什么呢,往往不太清楚,所以在使用的时候非常不舒服,下面把linux平台下常用的错误码列了下. 我是Fedora12系统,找到的定义文件是:/usr/includ ...

最新文章

  1. [笔记].关于在Quartus II 11.0无法正常使用SignalTap的解决方法
  2. 敏捷研发落地之持续集成
  3. 解决python中import时无法识别自己写的包和模块的方法
  4. Angular文件上传---fileUpload的使用
  5. [codevs1022]覆盖
  6. 一个html有几个css,几个CSS的黑科技_html/css_WEB-ITnose
  7. spring hsqldb_在Spring中嵌入HSQLDB服务器实例
  8. [react] shouldComponentUpdate方法是做什么的
  9. JAVA电子书大礼包
  10. 通过几种方式来查看windows vista的激活状态
  11. 微信公众号内置浏览器缓存清理
  12. rar压缩文件密码破解
  13. android最早的版本,光遇最早版本
  14. 分析武汉二手房房价信息
  15. 华为实验28-WAN接入配置
  16. 在Java中计算一元线性回归
  17. 自研数据库CynosDB存储系统如何实现即时恢复
  18. OSChina 周二乱弹 ——爸爸陆陆续续回家了
  19. AlarmManager与PendingIntent
  20. 计算机在英语课堂的应用,浅谈信息化技术在英语课堂的应用

热门文章

  1. oracle11g的tnstimeout,redhat下oracle11g 配置listener.ora
  2. UP及按照UP进行软件开发的流程
  3. leetcode题解53-最大子序和
  4. JAVA中多线程基础知识
  5. Oracle中on和where的区别
  6. 如何解决Office 2010安装报错1907,没有足够权限注册字体?
  7. linux内核学习笔记【一】临时内核页表 Provisional kernel Page Tables
  8. html5翻卡片游戏,用 JavaScript 写一个卡片小游戏
  9. linux上svn的使用教程,Linux上SVN的搭建使用
  10. gitlab php自动化测试,自动化发布-GitLab WEB Hooks 配置