xref: /DragonOS/kernel/src/common/errno.h (revision 676b8ef62e1a0a1e52d65b40c53c1636a2954040)
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 #define E2BIG 1         /* 参数列表过长,或者在输出buffer中缺少空间 或者参数比系统内建的最大值要大 Argument list too long. */
14 #define EACCES 2        /* 访问被拒绝 Permission denied */
15 #define EADDRINUSE 3    /* 地址正在被使用 Address in use.*/
16 #define EADDRNOTAVAIL 4 /* 地址不可用 Address  not available.*/
17 #define EAFNOSUPPORT 5  /* 地址family不支持 Address family not supported. */
18 #define EAGAIN 6        /* 资源不可用,请重试。 Resource unavailable, try again (may be the same value as [EWOULDBLOCK]).*/
19 #define EALREADY 7      /* 连接已经在处理 Connection already in progress. */
20 #define EBADF 8         /* 错误的文件描述符 Bad file descriptor. */
21 #define EBADMSG 9       /* 错误的消息 Bad message. */
22 
23 #define EBUSY 10        /* 设备或资源忙 Device or resource busy. */
24 #define ECANCELED 11    /* 操作被取消 Operation canceled. */
25 #define ECHILD 12       /* 没有子进程 No child processes. */
26 #define ECONNABORTED 13 /* 连接已断开 Connection aborted. */
27 #define ECONNREFUSED 14 /* 连接被拒绝 Connection refused. */
28 #define ECONNRESET 15   /* 连接被重置 Connection reset. */
29 #define EDEADLK 16      /* 资源死锁将要发生 Resource deadlock would occur. */
30 #define EDESTADDRREQ 17 /* 需要目标地址 Destination address required.*/
31 #define EDOM 18         /* 数学参数超出作用域 Mathematics argument out of domain of function. */
32 #define EDQUOT 19       /* 保留使用 Reserved */
33 
34 #define EEXIST 20       /* 文件已存在 File exists. */
35 #define EFAULT 21       /* 错误的地址 Bad address */
36 #define EFBIG 22        /* 文件太大 File too large. */
37 #define EHOSTUNREACH 23 /* 主机不可达 Host is unreachable.*/
38 #define EIDRM 24        /* 标志符被移除 Identifier removed. */
39 #define EILSEQ 25       /* 不合法的字符序列 Illegal byte sequence. */
40 #define EINPROGRESS 26  /* 操作正在处理 Operation in progress. */
41 #define EINTR 27        /* 被中断的函数 Interrupted function. */
42 #define EINVAL 28       /* 不可用的参数 Invalid argument. */
43 #define EIO 29          /* I/O错误 I/O error. */
44 
45 #define EISCONN 30      /* 套接字已连接 Socket is connected. */
46 #define EISDIR 31       /* 是一个目录 Is a directory */
47 #define ELOOP 32        /* 符号链接级别过多 Too many levels of symbolic links. */
48 #define EMFILE 33       /* 文件描述符的值过大 File descriptor value too large. */
49 #define EMLINK 34       /* 链接数过多 Too many links. */
50 #define EMSGSIZE 35     /* 消息过大 Message too large. */
51 #define EMULTIHOP 36    /* 保留使用 Reserved. */
52 #define ENAMETOOLONG 37 /* 文件名过长 Filename too long. */
53 #define ENETDOWN 38     /* 网络已关闭 Network is down. */
54 #define ENETRESET 39    /* 网络连接已断开 Connection aborted by network. */
55 
56 #define ENETUNREACH 40 /* 网络不可达 Network unreachable. */
57 #define ENFILE 41      /* 系统中打开的文件过多 Too many files open in system.*/
58 #define ENOBUFS 42     /* 缓冲区空间不足 No buffer space available. */
59 #define ENODATA 43     /* 队列头没有可读取的消息 No message is available on the STREAM head read queue. */
60 #define ENODEV 44      /* 没有指定的设备 No such device. */
61 #define ENOENT 45      /* 没有指定的文件或目录 No such file or directory. */
62 #define ENOEXEC 46     /* 可执行文件格式错误 Executable file format error. */
63 #define ENOLCK 47      /* 没有可用的锁 No locks available. */
64 #define ENOLINK 48     /* 保留 Reserved. */
65 #define ENOMEM 49      /* 没有足够的空间 Not enough space. */
66 
67 #define ENOMSG 50          /* 没有期待类型的消息 No message of the desired type. */
68 #define ENOPROTOOPT 51     /* 协议不可用 Protocol not available. */
69 #define ENOSPC 52          /* 设备上没有空间 No space left on device. */
70 #define ENOSR 53           /* 没有STREAM资源  No STREAM resources.*/
71 #define ENOSTR 54          /* 不是STREAM Not a STREAM */
72 #define ENOSYS 55          /* 功能不支持 Function not supported. */
73 #define ENOTCONN 56        /* 套接字未连接 The socket is not connected. */
74 #define ENOTDIR 57         /* 不是目录 Not a directory. */
75 #define ENOTEMPTY 58       /* 目录非空 Directory not empty. */
76 #define ENOTRECOVERABLE 59 /* 状态不可恢复 State not recoverable. */
77 
78 #define ENOTSOCK 60   /* 不是一个套接字 Not a socket.*/
79 #define ENOTSUP 61    /* 不被支持 Not supported (may be the same value as [EOPNOTSUPP]). */
80 #define ENOTTY 62     /* 不正确的I/O控制操作 Inappropriate I/O control operation. */
81 #define ENXIO 63      /* 没有这样的设备或地址 No such device or address. */
82 #define EOPNOTSUPP 64 /* 套接字不支持该操作 Operation not supported on socket (may be the same value as [ENOTSUP]). */
83 #define EOVERFLOW 65  /* 数值过大,产生溢出 Value too large to be stored in data type. */
84 #define EOWNERDEAD 66 /* 之前的拥有者挂了 Previous owner died. */
85 #define EPERM 67      /* 操作不被允许 Operation not permitted. */
86 #define EPIPE 68      /* 断开的管道 Broken pipe. */
87 #define EPROTO 69     /* 协议错误 Protocol error. */
88 
89 #define EPROTONOSUPPORT 70 /* 协议不被支持 Protocol not supported. */
90 #define EPROTOTYPE 71      /* 对于套接字而言,错误的协议 Protocol wrong type for socket. */
91 #define ERANGE 72          /* 结果过大 Result too large. */
92 #define EROFS 73           /* 只读的文件系统 Read-only file system. */
93 #define ESPIPE 74          /* 错误的寻道.当前文件是pipe,不允许seek请求  Invalid seek. */
94 #define ESRCH 75           /* 没有这样的进程 No such process. */
95 #define ESTALE 76          /* 保留 Reserved. */
96 #define ETIME 77           /* 流式ioctl()超时 Stream ioctl() timeout */
97 #define ETIMEDOUT 78       /* 连接超时 Connection timed out.*/
98 #define ETXTBSY 79         /* 文本文件忙 Text file busy. */
99 
100 #define EWOULDBLOCK 80 /* 操作将被禁止 Operation would block (may be the same value as [EAGAIN]). */
101 #define EXDEV 81       /* 跨设备连接 Cross-device link. */
102