1 /**
2  * @file errno.h
3  * @author fslongjin (longjin@RinGoTek.cn)
4  * @brief
5  * @version 0.1
6  * @date 2022-04-22
7  *
8  * @copyright Copyright (c) 2022
9  *
10  */
11 #pragma once
12 
13 #if defined(__cplusplus)
14 extern "C"
15 {
16 #endif
17 
18 #define EPERM 1             /* 操作不被允许 Operation not permitted. */
19 #define ENOENT 2            /* 没有指定的文件或目录 No such file or directory. */
20 #define ESRCH 3             /* 没有这样的进程 No such process. */
21 #define EINTR 4             /* 被中断的函数 Interrupted function. */
22 #define EIO 5               /* I/O错误 I/O error. */
23 #define ENXIO 6             /* 没有这样的设备或地址 No such device or address. */
24 #define E2BIG 7             /* 参数列表过长,或者在输出buffer中缺少空间 或者参数比系统内建的最大值要大 Argument list too long. */
25 #define ENOEXEC 8           /* 可执行文件格式错误 Executable file format error */
26 #define EBADF 9             /* 错误的文件描述符 Bad file descriptor. */
27 #define ECHILD 10           /* 没有子进程 No child processes. */
28 #define EAGAIN 11           /* 资源不可用,请重试。 Resource unavailable try again.(may be the same value as [EWOULDBLOCK]) */
29 #define EWOULDBLOCK 11      /* 操作将被禁止 Operation would block.(may be the same value as [EAGAIN]). */
30 #define ENOMEM 12           /* 没有足够的空间 Not enough space. */
31 #define EACCES 13           /* 访问被拒绝 Permission denied */
32 #define EFAULT 14           /* 错误的地址 Bad address */
33 #define ENOTBLK 15          /* 需要块设备 Block device required */
34 #define EBUSY 16            /* 设备或资源忙 Device or resource busy. */
35 #define EEXIST 17           /* 文件已存在 File exists. */
36 #define EXDEV 18            /* 跨设备连接 Cross-device link. */
37 #define ENODEV 19           /* 没有指定的设备 No such device. */
38 #define ENOTDIR 20          /* 不是目录 Not a directory. */
39 #define EISDIR 21           /* 是一个目录 Is a directory */
40 #define EINVAL 22           /* 不可用的参数 Invalid argument. */
41 #define ENFILE 23           /* 系统中打开的文件过多 Too many files open in system. */
42 #define EMFILE 24           /* 文件描述符的值过大 File descriptor value too large. */
43 #define ENOTTY 25           /* 不正确的I/O控制操作 Inappropriate I/O control operation. */
44 #define ETXTBSY 26          /* 文本文件忙 Text file busy. */
45 #define EFBIG 27            /* 文件太大 File too large. */
46 #define ENOSPC 28           /* 设备上没有空间 No space left on device. */
47 #define ESPIPE 29           /* 错误的寻道.当前文件是pipe,不允许seek请求  Invalid seek. */
48 #define EROFS 30            /* 只读的文件系统 Read-only file system. */
49 #define EMLINK 31           /* 链接数过多 Too many links. */
50 #define EPIPE 32            /* 断开的管道 Broken pipe. */
51 #define EDOM 33             /* 数学参数超出作用域 Mathematics argument out of domain of function. */
52 #define ERANGE 34           /* 结果过大 Result too large. */
53 #define EDEADLK 35          /* 资源死锁将要发生 Resource deadlock would occur. */
54 #define ENAMETOOLONG 36     /* 文件名过长 Filename too long. */
55 #define ENOLCK 37           /* 没有可用的锁 No locks available. */
56 #define ENOSYS 38           /* 功能不支持 Function not supported. */
57 #define ENOTEMPTY 39        /* 目录非空 Directory not empty. */
58 #define ELOOP 40            /* 符号链接级别过多 Too many levels of symbolic links. */
59 #define ENOMSG 41           /* 没有期待类型的消息 No message of the desired type. */
60 #define EIDRM 42            /* 标志符被移除 Identifier removed. */
61 #define ECHRNG 43           /* 通道号超出范围 Channel number out of range */
62 #define EL2NSYNC 44         /* 二级不同步 Level 2 not synchronized */
63 #define EL3HLT 45           /* 三级暂停 Level 3 halted */
64 #define EL3RST 46           /* 三级重置 Level 3 reset */
65 #define ELNRNG 47           /* 链接号超出范围 Link number out of range */
66 #define EUNATCH 48          /* 未连接协议驱动程序 Protocol driver not attached */
67 #define ENOCSI 49           /* 没有可用的CSI结构 No CSI structure available */
68 #define EL2HLT 50           /* 二级暂停 Level 2 halted */
69 #define EBADE 51            /* 无效交换 Invalid exchange */
70 #define EBADR 52            /* 无效的请求描述符 Invalid request descriptor */
71 #define EXFULL 53           /* 交换满 Exchange full */
72 #define ENOANO 54           /* 无阳极 No anode */
73 #define EBADRQC 55          /* 请求码无效 Invalid request code */
74 #define EBADSLT 56          /* 无效插槽 Invalid slot */
75 #define EDEADLOCK 57        /* 资源死锁 Resource deadlock would occur */
76 #define EBFONT 58           /* 错误的字体文件格式 Bad font file format */
77 #define ENOSTR 59           /* 不是STREAM Not a STREAM */
78 #define ENODATA 60          /* 队列头没有可读取的消息 No message is available on the STREAM head read queue. */
79 #define ETIME 61            /* 流式ioctl()超时 Stream ioctl() timeout */
80 #define ENOSR 62            /* 没有STREAM资源  No STREAM resources. */
81 #define ENONET 63           /* 机器不在网络上 Machine is not on the network */
82 #define ENOPKG 64           /* 未安装软件包 Package not installed */
83 #define EREMOTE 65          /* 远程对象 Object is remote */
84 #define ENOLINK 66          /* 保留 Reserved. */
85 #define EADV 67             /* 外设错误 Advertise error. */
86 #define ESRMNT 68           /* 安装错误 Srmount error */
87 #define ECOMM 69            /* 发送时发生通信错误 Communication error on send */
88 #define EPROTO 70           /* 协议错误 Protocol error. */
89 #define EMULTIHOP 71        /* 保留使用 Reserved. */
90 #define EDOTDOT 72          /* RFS特定错误 RFS specific error */
91 #define EBADMSG 73          /* 错误的消息 Bad message. */
92 #define EOVERFLOW 74        /* 数值过大,产生溢出 Value too large to be stored in data type. */
93 #define ENOTUNIQ 75         /* 名称在网络上不是唯一的 Name not unique on network */
94 #define EBADFD 76           /* 处于不良状态的文件描述符 File descriptor in bad state */
95 #define EREMCHG 77          /* 远程地址已更改 Remote address changed */
96 #define ELIBACC 78          /* 无法访问所需的共享库 Can not access a needed shared library */
97 #define ELIBBAD 79          /* 访问损坏的共享库 Accessing a corrupted shared library */
98 #define ELIBSCN 80          /* a. out中的.lib部分已损坏 .lib section in a.out corrupted */
99 #define ELIBMAX 81          /* 尝试链接太多共享库 Attempting to link in too many shared libraries */
100 #define ELIBEXEC 82         /* 无法直接执行共享库 Cannot exec a shared library directly */
101 #define EILSEQ 83           /* 不合法的字符序列 Illegal byte sequence. */
102 #define ERESTART 84         /* 中断的系统调用应该重新启动 Interrupted system call should be restarted */
103 #define ESTRPIPE 85         /* 流管道错误 Streams pipe error */
104 #define EUSERS 86           /* 用户太多 Too many users */
105 #define ENOTSOCK 87         /* 不是一个套接字 Not a socket. */
106 #define EDESTADDRREQ 88     /* 需要目标地址 Destination address required. */
107 #define EMSGSIZE 89         /* 消息过大 Message too large. */
108 #define EPROTOTYPE 90       /* 对于套接字而言,错误的协议 Protocol wrong type for socket. */
109 #define ENOPROTOOPT 91      /* 协议不可用 Protocol not available. */
110 #define EPROTONOSUPPORT 92  /* 协议不被支持 Protocol not supported. */
111 #define ESOCKTNOSUPPORT 93  /* 不支持套接字类型 Socket type not supported */
112 #define EOPNOTSUPP 94       /* 套接字不支持该操作 Operation not supported on socket (may be the same value as [ENOTSUP]). */
113 #define ENOTSUP 94          /* 不被支持 Not supported (may be the same value as [EOPNOTSUPP]). */
114 #define EPFNOSUPPORT 95     /* 不支持协议系列 Protocol family not supported */
115 #define EAFNOSUPPORT 96     /* 地址family不支持 Address family not supported. */
116 #define EADDRINUSE 97       /* 地址正在被使用 Address in use. */
117 #define EADDRNOTAVAIL 98    /* 地址不可用 Address  not available. */
118 #define ENETDOWN 99         /* 网络已关闭 Network is down. */
119 #define ENETUNREACH 100     /* 网络不可达 Network unreachable. */
120 #define ENETRESET 101       /* 网络连接已断开 Connection aborted by network. */
121 #define ECONNABORTED 102    /* 连接已断开 Connection aborted. */
122 #define ECONNRESET 103      /* 连接被重置 Connection reset. */
123 #define ENOBUFS 104         /* 缓冲区空间不足 No buffer space available. */
124 #define EISCONN 105         /* 套接字已连接 Socket is connected. */
125 #define ENOTCONN 106        /* 套接字未连接 The socket is not connected. */
126 #define ESHUTDOWN 107       /* 传输端点关闭后无法发送 Cannot send after transport endpoint shutdown */
127 #define ETOOMANYREFS 108    /* 引用太多:无法拼接 Too many references: cannot splice */
128 #define ETIMEDOUT 109       /* 连接超时 Connection timed out. */
129 #define ECONNREFUSED 110    /* 连接被拒绝 Connection refused. */
130 #define EHOSTDOWN 111       /* 主机已关闭 Host is down */
131 #define EHOSTUNREACH 112    /* 主机不可达 Host is unreachable. */
132 #define EALREADY 113        /* 连接已经在处理 Connection already in progress. */
133 #define EINPROGRESS 114     /* 操作正在处理 Operation in progress. */
134 #define ESTALE 115          /* 保留 Reserved. */
135 #define EUCLEAN 116         /* 结构需要清理 Structure needs cleaning */
136 #define ENOTNAM 117         /* 不是XENIX命名类型文件 Not a XENIX named type file */
137 #define ENAVAIL 118         /* 没有可用的XENIX信号量 No XENIX semaphores available */
138 #define EISNAM 119          /* 是命名类型文件 Is a named type file */
139 #define EREMOTEIO 120       /* 远程I/O错误 Remote I/O error */
140 #define EDQUOT 121          /* 保留使用 Reserved */
141 #define ENOMEDIUM 122       /* 没有找到媒介 No medium found */
142 #define EMEDIUMTYPE 123     /* 介质类型错误 Wrong medium type */
143 #define ECANCELED 124       /* 操作被取消 Operation canceled. */
144 #define ENOKEY 125          /* 所需的密钥不可用 Required key not available */
145 #define EKEYEXPIRED 126     /* 密钥已过期 Key has expired */
146 #define EKEYREVOKED 127     /* 密钥已被撤销 Key has been revoked */
147 #define EKEYREJECTED 128    /* 密钥被服务拒绝 Key has been revoked */
148 #define EOWNERDEAD 129      /* 之前的拥有者挂了 Previous owner died. */
149 #define ENOTRECOVERABLE 130 /* 状态不可恢复 State not recoverable. */
150 
151     extern int errno;
152 
153 #if defined(__cplusplus)
154 } /* extern "C" */
155 #endif