xref: /freebsd/contrib/lib9p/linux_errno.h (revision 134e1779)
1 /*
2  * Copyright 2016 Chris Torek <torek@ixsystems.com>
3  * All rights reserved
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted providing that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
18  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
22  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
23  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24  * POSSIBILITY OF SUCH DAMAGE.
25  *
26  */
27 
28 #ifndef LIB9P_LINUX_ERRNO_H
29 #define LIB9P_LINUX_ERRNO_H
30 
31 /*
32  * Linux error numbers that are outside of the original base range
33  * (which ends with ERANGE).
34  *
35  * This is pretty much the same as Linux's errno.h except that the
36  * names are prefixed with "LINUX_", and we add _STR with the
37  * string name.
38  *
39  * The string expansions were obtained with a little program to
40  * print every strerror().
41  *
42  * Note that BSD EDEADLK is 11 and BSD EAGAIN is 35, vs
43  * Linux / Plan9 EAGAIN at 11.  So one value in the ERANGE
44  * range still needs translation too.
45  */
46 
47 #define	LINUX_EAGAIN		11
48 #define	LINUX_EAGAIN_STR	"Resource temporarily unavailable"
49 
50 #define	LINUX_EDEADLK		35
51 #define	LINUX_EDEADLK_STR	"Resource deadlock avoided"
52 #define	LINUX_ENAMETOOLONG	36
53 #define	LINUX_ENAMETOOLONG_STR	"File name too long"
54 #define	LINUX_ENOLCK		37
55 #define	LINUX_ENOLCK_STR	"No locks available"
56 #define	LINUX_ENOSYS		38
57 #define	LINUX_ENOSYS_STR	"Function not implemented"
58 #define	LINUX_ENOTEMPTY		39
59 #define	LINUX_ENOTEMPTY_STR	"Directory not empty"
60 #define	LINUX_ELOOP		40
61 #define	LINUX_ELOOP_STR		"Too many levels of symbolic links"
62 /*				41 unused */
63 #define	LINUX_ENOMSG		42
64 #define	LINUX_ENOMSG_STR	"No message of desired type"
65 #define	LINUX_EIDRM		43
66 #define	LINUX_EIDRM_STR		"Identifier removed"
67 #define	LINUX_ECHRNG		44
68 #define	LINUX_ECHRNG_STR	"Channel number out of range"
69 #define	LINUX_EL2NSYNC		45
70 #define	LINUX_EL2NSYNC_STR	"Level 2 not synchronized"
71 #define	LINUX_EL3HLT		46
72 #define	LINUX_EL3HLT_STR	"Level 3 halted"
73 #define	LINUX_EL3RST		47
74 #define	LINUX_EL3RST_STR	"Level 3 reset"
75 #define	LINUX_ELNRNG		48
76 #define	LINUX_ELNRNG_STR	"Link number out of range"
77 #define	LINUX_EUNATCH		49
78 #define	LINUX_EUNATCH_STR	"Protocol driver not attached"
79 #define	LINUX_ENOCSI		50
80 #define	LINUX_ENOCSI_STR	"No CSI structure available"
81 #define	LINUX_EL2HLT		51
82 #define	LINUX_EL2HLT_STR	"Level 2 halted"
83 #define	LINUX_EBADE		52
84 #define	LINUX_EBADE_STR		"Invalid exchange"
85 #define	LINUX_EBADR		53
86 #define	LINUX_EBADR_STR		"Invalid request descriptor"
87 #define	LINUX_EXFULL		54
88 #define	LINUX_EXFULL_STR	"Exchange full"
89 #define	LINUX_ENOANO		55
90 #define	LINUX_ENOANO_STR	"No anode"
91 #define	LINUX_EBADRQC		56
92 #define	LINUX_EBADRQC_STR	"Invalid request code"
93 #define	LINUX_EBADSLT		57
94 #define	LINUX_EBADSLT_STR	"Invalid slot"
95 /*				58 unused */
96 #define	LINUX_EBFONT		59
97 #define	LINUX_EBFONT_STR	"Bad font file format"
98 #define	LINUX_ENOSTR		60
99 #define	LINUX_ENOSTR_STR	"Device not a stream"
100 #define	LINUX_ENODATA		61
101 #define	LINUX_ENODATA_STR	"No data available"
102 #define	LINUX_ETIME		62
103 #define	LINUX_ETIME_STR		"Timer expired"
104 #define	LINUX_ENOSR		63
105 #define	LINUX_ENOSR_STR		"Out of streams resources"
106 #define	LINUX_ENONET		64
107 #define	LINUX_ENONET_STR	"Machine is not on the network"
108 #define	LINUX_ENOPKG		65
109 #define	LINUX_ENOPKG_STR	"Package not installed"
110 #define	LINUX_EREMOTE		66
111 #define	LINUX_EREMOTE_STR	"Object is remote"
112 #define	LINUX_ENOLINK		67
113 #define	LINUX_ENOLINK_STR	"Link has been severed"
114 #define	LINUX_EADV		68
115 #define	LINUX_EADV_STR		"Advertise error"
116 #define	LINUX_ESRMNT		69
117 #define	LINUX_ESRMNT_STR	"Srmount error"
118 #define	LINUX_ECOMM		70
119 #define	LINUX_ECOMM_STR		"Communication error on send"
120 #define	LINUX_EPROTO		71
121 #define	LINUX_EPROTO_STR	"Protocol error"
122 #define	LINUX_EMULTIHOP		72
123 #define	LINUX_EMULTIHOP_STR	"Multihop attempted"
124 #define	LINUX_EDOTDOT		73
125 #define	LINUX_EDOTDOT_STR	"RFS specific error"
126 #define	LINUX_EBADMSG		74
127 #define	LINUX_EBADMSG_STR	"Bad message"
128 #define	LINUX_EOVERFLOW		75
129 #define	LINUX_EOVERFLOW_STR	"Value too large for defined data type"
130 #define	LINUX_ENOTUNIQ		76
131 #define	LINUX_ENOTUNIQ_STR	"Name not unique on network"
132 #define	LINUX_EBADFD		77
133 #define	LINUX_EBADFD_STR	"File descriptor in bad state"
134 #define	LINUX_EREMCHG		78
135 #define	LINUX_EREMCHG_STR	"Remote address changed"
136 #define	LINUX_ELIBACC		79
137 #define	LINUX_ELIBACC_STR	"Can not access a needed shared library"
138 #define	LINUX_ELIBBAD		80
139 #define	LINUX_ELIBBAD_STR	"Accessing a corrupted shared library"
140 #define	LINUX_ELIBSCN		81
141 #define	LINUX_ELIBSCN_STR	".lib section in a.out corrupted"
142 #define	LINUX_ELIBMAX		82
143 #define	LINUX_ELIBMAX_STR	"Attempting to link in too many shared libraries"
144 #define	LINUX_ELIBEXEC		83
145 #define	LINUX_ELIBEXEC_STR	"Cannot exec a shared library directly"
146 #define	LINUX_EILSEQ		84
147 #define	LINUX_EILSEQ_STR	"Invalid or incomplete multibyte or wide character"
148 #define	LINUX_ERESTART		85
149 #define	LINUX_ERESTART_STR	"Interrupted system call should be restarted"
150 #define	LINUX_ESTRPIPE		86
151 #define	LINUX_ESTRPIPE_STR	"Streams pipe error"
152 #define	LINUX_EUSERS		87
153 #define	LINUX_EUSERS_STR	"Too many users"
154 #define	LINUX_ENOTSOCK		88
155 #define	LINUX_ENOTSOCK_STR	"Socket operation on non-socket"
156 #define	LINUX_EDESTADDRREQ	89
157 #define	LINUX_EDESTADDRREQ_STR	"Destination address required"
158 #define	LINUX_EMSGSIZE		90
159 #define	LINUX_EMSGSIZE_STR	"Message too long"
160 #define	LINUX_EPROTOTYPE	91
161 #define	LINUX_EPROTOTYPE_STR	"Protocol wrong type for socket"
162 #define	LINUX_ENOPROTOOPT	92
163 #define	LINUX_ENOPROTOOPT_STR	"Protocol not available"
164 #define	LINUX_EPROTONOSUPPORT	93
165 #define	LINUX_EPROTONOSUPPORT_STR "Protocol not supported"
166 #define	LINUX_ESOCKTNOSUPPORT	94
167 #define	LINUX_ESOCKTNOSUPPORT_STR "Socket type not supported"
168 #define	LINUX_EOPNOTSUPP	95
169 #define	LINUX_EOPNOTSUPP_STR	"Operation not supported"
170 #define	LINUX_EPFNOSUPPORT	96
171 #define	LINUX_EPFNOSUPPORT_STR	"Protocol family not supported"
172 #define	LINUX_EAFNOSUPPORT	97
173 #define	LINUX_EAFNOSUPPORT_STR	"Address family not supported by protocol"
174 #define	LINUX_EADDRINUSE	98
175 #define	LINUX_EADDRINUSE_STR	"Address already in use"
176 #define	LINUX_EADDRNOTAVAIL	99
177 #define	LINUX_EADDRNOTAVAIL_STR	"Cannot assign requested address"
178 #define	LINUX_ENETDOWN		100
179 #define	LINUX_ENETDOWN_STR	"Network is down"
180 #define	LINUX_ENETUNREACH	101
181 #define	LINUX_ENETUNREACH_STR	"Network is unreachable"
182 #define	LINUX_ENETRESET		102
183 #define	LINUX_ENETRESET_STR	"Network dropped connection on reset"
184 #define	LINUX_ECONNABORTED	103
185 #define	LINUX_ECONNABORTED_STR	"Software caused connection abort"
186 #define	LINUX_ECONNRESET	104
187 #define	LINUX_ECONNRESET_STR	"Connection reset by peer"
188 #define	LINUX_ENOBUFS		105
189 #define	LINUX_ENOBUFS_STR	"No buffer space available"
190 #define	LINUX_EISCONN		106
191 #define	LINUX_EISCONN_STR	"Transport endpoint is already connected"
192 #define	LINUX_ENOTCONN		107
193 #define	LINUX_ENOTCONN_STR	"Transport endpoint is not connected"
194 #define	LINUX_ESHUTDOWN		108
195 #define	LINUX_ESHUTDOWN_STR	"Cannot send after transport endpoint shutdown"
196 #define	LINUX_ETOOMANYREFS	109
197 #define	LINUX_ETOOMANYREFS_STR	"Too many references: cannot splice"
198 #define	LINUX_ETIMEDOUT		110
199 #define	LINUX_ETIMEDOUT_STR	"Connection timed out"
200 #define	LINUX_ECONNREFUSED	111
201 #define	LINUX_ECONNREFUSED_STR	"Connection refused"
202 #define	LINUX_EHOSTDOWN		112
203 #define	LINUX_EHOSTDOWN_STR	"Host is down"
204 #define	LINUX_EHOSTUNREACH	113
205 #define	LINUX_EHOSTUNREACH_STR	"No route to host"
206 #define	LINUX_EALREADY		114
207 #define	LINUX_EALREADY_STR	"Operation already in progress"
208 #define	LINUX_EINPROGRESS	115
209 #define	LINUX_EINPROGRESS_STR	"Operation now in progress"
210 #define	LINUX_ESTALE		116
211 #define	LINUX_ESTALE_STR	"Stale file handle"
212 #define	LINUX_EUCLEAN		117
213 #define	LINUX_EUCLEAN_STR	"Structure needs cleaning"
214 #define	LINUX_ENOTNAM		118
215 #define	LINUX_ENOTNAM_STR	"Not a XENIX named type file"
216 #define	LINUX_ENAVAIL		119
217 #define	LINUX_ENAVAIL_STR	"No XENIX semaphores available"
218 #define	LINUX_EISNAM		120
219 #define	LINUX_EISNAM_STR	"Is a named type file"
220 #define	LINUX_EREMOTEIO		121
221 #define	LINUX_EREMOTEIO_STR	"Remote I/O error"
222 #define	LINUX_EDQUOT		122
223 #define	LINUX_EDQUOT_STR	"Quota exceeded"
224 #define	LINUX_ENOMEDIUM		123
225 #define	LINUX_ENOMEDIUM_STR	"No medium found"
226 #define	LINUX_EMEDIUMTYPE	124
227 #define	LINUX_EMEDIUMTYPE_STR	"Wrong medium type"
228 #define	LINUX_ECANCELED		125
229 #define	LINUX_ECANCELED_STR	"Operation canceled"
230 #define	LINUX_ENOKEY		126
231 #define	LINUX_ENOKEY_STR	"Required key not available"
232 #define	LINUX_EKEYEXPIRED	127
233 #define	LINUX_EKEYEXPIRED_STR	"Key has expired"
234 #define	LINUX_EKEYREVOKED	128
235 #define	LINUX_EKEYREVOKED_STR	"Key has been revoked"
236 #define	LINUX_EKEYREJECTED	129
237 #define	LINUX_EKEYREJECTED_STR	"Key was rejected by service"
238 #define	LINUX_EOWNERDEAD	130
239 #define	LINUX_EOWNERDEAD_STR	"Owner died"
240 #define	LINUX_ENOTRECOVERABLE	131
241 #define	LINUX_ENOTRECOVERABLE_STR "State not recoverable"
242 #define	LINUX_ERFKILL		132
243 #define	LINUX_ERFKILL_STR	"Operation not possible due to RF-kill"
244 #define	LINUX_EHWPOISON		133
245 #define	LINUX_EHWPOISON_STR	"Memory page has hardware error"
246 
247 #endif	/* LIB9P_LINUX_ERRNO_H */
248