• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Institute of Parallel And Distributed Systems (IPADS), Shanghai Jiao Tong University (SJTU)
3  * Licensed under the Mulan PSL v2.
4  * You can use this software according to the terms and conditions of the Mulan PSL v2.
5  * You may obtain a copy of Mulan PSL v2 at:
6  *     http://license.coscl.org.cn/MulanPSL2
7  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
8  * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
9  * PURPOSE.
10  * See the Mulan PSL v2 for more details.
11  */
12 
13 #ifndef COMMON_ERRNO_H
14 #define COMMON_ERRNO_H
15 
16 #define EPERM   1 /* Operation not permitted */
17 #define ENOENT  2 /* No such file or directory/Entry does not exist */
18 #define ESRCH   3 /* No such process */
19 #define EINTR   4 /* Interrupted system call */
20 #define EIO     5 /* I/O error */
21 #define ENXIO   6 /* No such device or address */
22 #define E2BIG   7 /* Argument list too long */
23 #define ENOEXEC 8 /* Exec format error */
24 #define EBADF   9 /* Bad file number */
25 #define ECHILD  10 /* No child processes */
26 #define EAGAIN  11 /* Try again */
27 #define ENOMEM  12 /* Out of memory */
28 #define EACCES  13 /* Permission denied */
29 #define EFAULT  14 /* Bad address */
30 #define ENOTBLK 15 /* Block device required */
31 #define EBUSY   16 /* Device or resource busy */
32 #define EEXIST  17 /* File exists */
33 #define EXDEV   18 /* Cross-device link */
34 #define ENODEV  19 /* No such device */
35 #define ENOTDIR 20 /* Not a directory */
36 #define EISDIR  21 /* Is a directory */
37 #define EINVAL  22 /* Invalid argument */
38 #define ENFILE  23 /* File table overflow */
39 #define EMFILE  24 /* Too many open files */
40 #define ENOTTY  25 /* Not a typewriter */
41 #define ETXTBSY 26 /* Text file busy */
42 #define EFBIG   27 /* File too large */
43 #define ENOSPC  28 /* No space left on device */
44 #define ESPIPE  29 /* Illegal seek */
45 #define EROFS   30 /* Read-only file system */
46 #define EMLINK  31 /* Too many links */
47 #define EPIPE   32 /* Broken pipe */
48 #define EDOM    33 /* Math argument out of domain of func */
49 
50 #define ERANGE          34 /* Math result not representable */
51 #define EDEADLK         35
52 #define ENAMETOOLONG    36
53 #define ENOLCK          37
54 #define ENOSYS          38 /* Function not implemented */
55 #define ENOTEMPTY       39 /* Dir is not empty */
56 #define ELOOP           40
57 #define EWOULDBLOCK     EAGAIN
58 #define ENOMSG          42
59 #define EIDRM           43
60 #define ECHRNG          44
61 #define EL2NSYNC        45
62 #define EL3HLT          46
63 #define EL3RST          47
64 #define ELNRNG          48
65 #define EUNATCH         49
66 #define ENOCSI          50
67 #define EL2HLT          51
68 #define EBADE           52
69 #define EBADR           53
70 #define EXFULL          54
71 #define ENOANO          55
72 #define EBADRQC         56
73 #define EBADSLT         57
74 #define EDEADLOCK       EDEADLK
75 #define EBFONT          59
76 #define ENOSTR          60
77 #define ENODATA         61 /* No data available */
78 #define ETIME           62 /* Timer expired */
79 #define ENOSR           63
80 #define ENONET          64
81 #define ENOPKG          65
82 #define EREMOTE         66
83 #define ENOLINK         67
84 #define EADV            68
85 #define ESRMNT          69
86 #define ECOMM           70
87 #define EPROTO          71
88 #define EMULTIHOP       72
89 #define EDOTDOT         73
90 #define EBADMSG         74
91 #define EOVERFLOW       75
92 #define ENOTUNIQ        76
93 #define EBADFD          77
94 #define EREMCHG         78
95 #define ELIBACC         79
96 #define ELIBBAD         80
97 #define ELIBSCN         81
98 #define ELIBMAX         82
99 #define ELIBEXEC        83
100 #define EILSEQ          84
101 #define ERESTART        85
102 #define ESTRPIPE        86
103 #define EUSERS          87
104 #define ENOTSOCK        88
105 #define EDESTADDRREQ    89
106 #define EMSGSIZE        90
107 #define EPROTOTYPE      91
108 #define ENOPROTOOPT     92
109 #define EPROTONOSUPPORT 93
110 #define ESOCKTNOSUPPORT 94
111 #define EOPNOTSUPP      95
112 #define ENOTSUP         EOPNOTSUPP
113 #define EPFNOSUPPORT    96
114 #define EAFNOSUPPORT    97
115 #define EADDRINUSE      98
116 #define EADDRNOTAVAIL   99
117 #define ENETDOWN        100
118 #define ENETUNREACH     101
119 #define ENETRESET       102
120 #define ECONNABORTED    103
121 #define ECONNRESET      104
122 #define ENOBUFS         105
123 #define EISCONN         106
124 #define ENOTCONN        107
125 #define ESHUTDOWN       108
126 #define ETOOMANYREFS    109
127 #define ETIMEDOUT       110
128 #define ECONNREFUSED    111
129 #define EHOSTDOWN       112
130 #define EHOSTUNREACH    113
131 #define EALREADY        114
132 #define EINPROGRESS     115
133 #define ESTALE          116
134 #define EUCLEAN         117
135 #define ENOTNAM         118
136 #define ENAVAIL         119
137 #define EISNAM          120
138 #define EREMOTEIO       121
139 #define EDQUOT          122
140 #define ENOMEDIUM       123
141 #define EMEDIUMTYPE     124
142 #define ECANCELED       125
143 #define ENOKEY          126
144 #define EKEYEXPIRED     127
145 #define EKEYREVOKED     128
146 #define EKEYREJECTED    129
147 #define EOWNERDEAD      130
148 #define ENOTRECOVERABLE 131
149 #define ERFKILL         132
150 #define EHWPOISON       133
151 
152 /* ChCore specific */
153 #define EIPCRETRY   199 /* Retry the IPC call */
154 #define ECAPBILITY  200 /* Invalid capability */
155 #define EBADSYSCALL 202 /* Bad syscall number */
156 #define ENOMAPPING  203 /* No memory mapping in pgtbl */
157 
158 #define EMAX 205
159 
160 #define ERR_PTR(x) ((void *)(long)(x))
161 #define PTR_ERR(x) ((long)(x))
162 #define IS_ERR(x)  ((((long)(x)) < 0) && ((long)(x)) > -EMAX)
163 
164 #endif /* COMMON_ERRNO_H */
165