xref: /freebsd/sys/compat/linux/linux_errno.h (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2020 The FreeBSD Foundation
5  *
6  * This software was developed by Edward Tomasz Napierala under sponsorship
7  * from the FreeBSD Foundation.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  */
30 
31 #ifndef _LINUX_ERRNO_H_
32 #define _LINUX_ERRNO_H_
33 
34 #define	LINUX_EPERM		1
35 #define	LINUX_ENOENT		2
36 #define	LINUX_ESRCH		3
37 #define	LINUX_EINTR		4
38 #define	LINUX_EIO		5
39 #define	LINUX_ENXIO		6
40 #define	LINUX_E2BIG		7
41 #define	LINUX_ENOEXEC		8
42 #define	LINUX_EBADF		9
43 
44 #define	LINUX_ECHILD		10
45 #define	LINUX_EAGAIN		11
46 #define	LINUX_ENOMEM		12
47 #define	LINUX_EACCES		13
48 #define	LINUX_EFAULT		14
49 #define	LINUX_ENOTBLK		15
50 #define	LINUX_EBUSY		16
51 #define	LINUX_EEXIST		17
52 #define	LINUX_EXDEV		18
53 #define	LINUX_ENODEV		19
54 
55 #define	LINUX_ENOTDIR		20
56 #define	LINUX_EISDIR		21
57 #define	LINUX_EINVAL		22
58 #define	LINUX_ENFILE		23
59 #define	LINUX_EMFILE		24
60 #define	LINUX_ENOTTY		25
61 #define	LINUX_ETXTBSY		26
62 #define	LINUX_EFBIG		27
63 #define	LINUX_ENOSPC		28
64 #define	LINUX_ESPIPE		29
65 
66 #define	LINUX_EROFS		30
67 #define	LINUX_EMLINK		31
68 #define	LINUX_EPIPE		32
69 #define	LINUX_EDOM		33
70 #define	LINUX_ERANGE		34
71 #define	LINUX_EDEADLK		35
72 #define	LINUX_ENAMETOOLONG	36
73 #define	LINUX_ENOLCK		37
74 #define	LINUX_ENOSYS		38
75 #define	LINUX_ENOTEMPTY		39
76 
77 #define	LINUX_ELOOP		40
78 /* XXX: errno 41 is not defined in Linux. */
79 #define	LINUX_ENOMSG		42
80 #define	LINUX_EIDRM		43
81 #define	LINUX_ECHRNG		44
82 #define	LINUX_EL2NSYNC		45
83 #define	LINUX_EL3HLT		46
84 #define	LINUX_EL3RST		47
85 #define	LINUX_ELNRNG		48
86 #define	LINUX_EUNATCH		49
87 
88 #define	LINUX_ENOCSI		50
89 #define	LINUX_EL2HLT		51
90 #define	LINUX_EBADE		52
91 #define	LINUX_EBADR		53
92 #define	LINUX_EXFULL		54
93 #define	LINUX_ENOANO		55
94 #define	LINUX_EBADRQC		56
95 #define	LINUX_EBADSLT		57
96 /* XXX: errno 58 is not defined in Linux. */
97 #define	LINUX_EBFONT		59
98 
99 #define	LINUX_ENOSTR		60
100 #define	LINUX_ENODATA		61
101 #define	LINUX_ENOTIME		62
102 #define	LINUX_ENOSR		63
103 #define	LINUX_ENONET		64
104 #define	LINUX_ENOPKG		65
105 #define	LINUX_EREMOTE		66
106 #define	LINUX_ENOLINK		67
107 #define	LINUX_EADV		68
108 #define	LINUX_ESRMNT		69
109 
110 #define	LINUX_ECOMM		70
111 #define	LINUX_EPROTO		71
112 #define	LINUX_EMULTIHOP		72
113 #define	LINUX_EDOTDOT		73
114 #define	LINUX_EBADMSG		74
115 #define	LINUX_EOVERFLOW		75
116 #define	LINUX_ENOTUNIQ		76
117 #define	LINUX_EBADFD		77
118 #define	LINUX_EREMCHG		78
119 #define	LINUX_ELIBACC		79
120 
121 #define	LINUX_ELIBBAD		80
122 #define	LINUX_ELIBSCN		81
123 #define	LINUX_ELIBMAX		82
124 #define	LINUX_ELIBEXEC		83
125 #define	LINUX_EILSEQ		84
126 #define	LINUX_ERESTART		85
127 #define	LINUX_ESTRPIPE		86
128 #define	LINUX_EUSERS		87
129 #define	LINUX_ENOTSOCK		88
130 #define	LINUX_EDESTADDRREQ	89
131 
132 #define	LINUX_EMSGSIZE		90
133 #define	LINUX_EPROTOTYPE	91
134 #define	LINUX_ENOPROTOOPT	92
135 #define	LINUX_EPROTONOTSUPPORT	93
136 #define	LINUX_ESOCKNOTSUPPORT	94
137 #define	LINUX_EOPNOTSUPPORT	95
138 #define	LINUX_EPFNOTSUPPORT	96
139 #define	LINUX_EAFNOTSUPPORT	97
140 #define	LINUX_EADDRINUSE	98
141 #define	LINUX_EADDRNOTAVAIL	99
142 
143 #define	LINUX_ENETDOWN		100
144 #define	LINUX_ENETUNREACH	101
145 #define	LINUX_ENETRESET		102
146 #define	LINUX_ECONNABORTED	103
147 #define	LINUX_ECONNRESET	104
148 #define	LINUX_ENOBUFS		105
149 #define	LINUX_EISCONN		106
150 #define	LINUX_ENOTCONN		107
151 #define	LINUX_ESHUTDOWN		108
152 #define	LINUX_ETOOMANYREFS	109
153 
154 #define	LINUX_ETIMEDOUT		110
155 #define	LINUX_ECONNREFUSED	111
156 #define	LINUX_EHOSTDOWN		112
157 #define	LINUX_EHOSTUNREACH	113
158 #define	LINUX_EALREADY		114
159 #define	LINUX_EINPROGRESS	115
160 #define	LINUX_ESTALE		116
161 #define	LINUX_EUCLEAN		117
162 #define	LINUX_ENOTNAM		118
163 #define	LINUX_ENAVAIL		119
164 
165 #define	LINUX_EISNAM		120
166 #define	LINUX_EREMOTEIO		121
167 #define	LINUX_EDQUOT		122
168 #define	LINUX_ENOMEDIUM		123
169 #define	LINUX_EMEDIUMTYPE	124
170 #define	LINUX_ECANCELED		125
171 #define	LINUX_ENOKEY		126
172 #define	LINUX_EKEYEXPIRED	127
173 #define	LINUX_EKEYREVOKED	128
174 #define	LINUX_EKEYREJECTED	129
175 
176 #define	LINUX_EOWNERDEAD	130
177 #define	LINUX_ENOTRECOVERABLE	131
178 #define	LINUX_ERFKILL		132
179 #define	LINUX_EHWPOISON		133
180 
181 #define	LINUX_ELAST		LINUX_EHWPOISON
182 
183 /*
184  * This is a special "internal" errno that must never be returned
185  * to a Linux process, but might be observed via ptrace(2).
186  */
187 #define	LINUX_ERESTARTSYS	512
188 
189 #endif /* _LINUX_ERRNO_H_ */
190