errno.d revision 333617
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 *
22 * Portions Copyright 2006-2008 John Birrell jb@freebsd.org
23 * Portions Copyright 2018 Devin Teske dteske@freebsd.org
24 *
25 * $FreeBSD: stable/11/cddl/lib/libdtrace/errno.d 333617 2018-05-15 00:00:44Z dteske $
26 */
27/*
28 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
29 * Use is subject to license terms.
30 */
31
32inline int EPERM = 1;
33#pragma D binding "1.0" EPERM
34inline int ENOENT = 2;
35#pragma D binding "1.0" ENOENT
36inline int ESRCH = 3;
37#pragma D binding "1.0" ESRCH
38inline int EINTR = 4;
39#pragma D binding "1.0" EINTR
40inline int EIO = 5;
41#pragma D binding "1.0" EIO
42inline int ENXIO = 6;
43#pragma D binding "1.0" ENXIO
44inline int E2BIG = 7;
45#pragma D binding "1.0" E2BIG
46inline int ENOEXEC = 8;
47#pragma D binding "1.0" ENOEXEC
48inline int EBADF = 9;
49#pragma D binding "1.0" EBADF
50inline int ECHILD = 10;
51#pragma D binding "1.0" ECHILD
52inline int EDEADLK = 11;
53#pragma D binding "1.0" EDEADLK
54inline int ENOMEM = 12;
55#pragma D binding "1.0" ENOMEM
56inline int EACCES = 13;
57#pragma D binding "1.0" EACCES
58inline int EFAULT = 14;
59#pragma D binding "1.0" EFAULT
60inline int ENOTBLK = 15;
61#pragma D binding "1.0" ENOTBLK
62inline int EBUSY = 16;
63#pragma D binding "1.0" EBUSY
64inline int EEXIST = 17;
65#pragma D binding "1.0" EEXIST
66inline int EXDEV = 18;
67#pragma D binding "1.0" EXDEV
68inline int ENODEV = 19;
69#pragma D binding "1.0" ENODEV
70inline int ENOTDIR = 20;
71#pragma D binding "1.0" ENOTDIR
72inline int EISDIR = 21;
73#pragma D binding "1.0" EISDIR
74inline int EINVAL = 22;
75#pragma D binding "1.0" EINVAL
76inline int ENFILE = 23;
77#pragma D binding "1.0" ENFILE
78inline int EMFILE = 24;
79#pragma D binding "1.0" EMFILE
80inline int ENOTTY = 25;
81#pragma D binding "1.0" ENOTTY
82inline int ETXTBSY = 26;
83#pragma D binding "1.0" ETXTBSY
84inline int EFBIG = 27;
85#pragma D binding "1.0" EFBIG
86inline int ENOSPC = 28;
87#pragma D binding "1.0" ENOSPC
88inline int ESPIPE = 29;
89#pragma D binding "1.0" ESPIPE
90inline int EROFS = 30;
91#pragma D binding "1.0" EROFS
92inline int EMLINK = 31;
93#pragma D binding "1.0" EMLINK
94inline int EPIPE = 32;
95#pragma D binding "1.0" EPIPE
96inline int EDOM = 33;
97#pragma D binding "1.0" EDOM
98inline int ERANGE = 34;
99#pragma D binding "1.0" ERANGE
100inline int EAGAIN = 35;
101#pragma D binding "1.0" EAGAIN
102inline int EWOULDBLOCK = EAGAIN;
103#pragma D binding "1.0" EWOULDBLOCK
104inline int EINPROGRESS = 36;
105#pragma D binding "1.0" EINPROGRESS
106inline int EALREADY = 37;
107#pragma D binding "1.0" EALREADY
108inline int ENOTSOCK = 38;
109#pragma D binding "1.0" ENOTSOCK
110inline int EDESTADDRREQ = 39;
111#pragma D binding "1.0" EDESTADDRREQ
112inline int EMSGSIZE = 40;
113#pragma D binding "1.0" EMSGSIZE
114inline int EPROTOTYPE = 41;
115#pragma D binding "1.0" EPROTOTYPE
116inline int ENOPROTOOPT = 42;
117#pragma D binding "1.0" ENOPROTOOPT
118inline int EPROTONOSUPPORT = 43;
119#pragma D binding "1.0" EPROTONOSUPPORT
120inline int ESOCKTNOSUPPORT = 44;
121#pragma D binding "1.0" ESOCKTNOSUPPORT
122inline int EOPNOTSUPP = 45;
123#pragma D binding "1.0" EOPNOTSUPP
124inline int ENOTSUP = EOPNOTSUPP;
125#pragma D binding "1.0" ENOTSUP
126inline int EPFNOSUPPORT = 46;
127#pragma D binding "1.0" EPFNOSUPPORT
128inline int EAFNOSUPPORT = 47;
129#pragma D binding "1.0" EAFNOSUPPORT
130inline int EADDRINUSE = 48;
131#pragma D binding "1.0" EADDRINUSE
132inline int EADDRNOTAVAIL = 49;
133#pragma D binding "1.0" EADDRNOTAVAIL
134inline int ENETDOWN = 50;
135#pragma D binding "1.0" ENETDOWN
136inline int ENETUNREACH = 51;
137#pragma D binding "1.0" ENETUNREACH
138inline int ENETRESET = 52;
139#pragma D binding "1.0" ENETRESET
140inline int ECONNABORTED = 53;
141#pragma D binding "1.0" ECONNABORTED
142inline int ECONNRESET = 54;
143#pragma D binding "1.0" ECONNRESET
144inline int ENOBUFS = 55;
145#pragma D binding "1.0" ENOBUFS
146inline int EISCONN = 56;
147#pragma D binding "1.0" EISCONN
148inline int ENOTCONN = 57;
149#pragma D binding "1.0" ENOTCONN
150inline int ESHUTDOWN = 58;
151#pragma D binding "1.0" ESHUTDOWN
152inline int ETOOMANYREFS = 59;
153#pragma D binding "1.0" ETOOMANYREFS
154inline int ETIMEDOUT = 60;
155#pragma D binding "1.0" ETIMEDOUT
156inline int ECONNREFUSED = 61;
157#pragma D binding "1.0" ECONNREFUSED
158inline int ELOOP = 62;
159#pragma D binding "1.0" ELOOP
160inline int ENAMETOOLONG = 63;
161#pragma D binding "1.0" ENAMETOOLONG
162inline int EHOSTDOWN = 64;
163#pragma D binding "1.0" EHOSTDOWN
164inline int EHOSTUNREACH = 65;
165#pragma D binding "1.0" EHOSTUNREACH
166inline int ENOTEMPTY = 66;
167#pragma D binding "1.0" ENOTEMPTY
168inline int EPROCLIM = 67;
169#pragma D binding "1.0" EPROCLIM
170inline int EUSERS = 68;
171#pragma D binding "1.0" EUSERS
172inline int EDQUOT = 69;
173#pragma D binding "1.0" EDQUOT
174inline int ESTALE = 70;
175#pragma D binding "1.0" ESTALE
176inline int EREMOTE = 71;
177#pragma D binding "1.0" EREMOTE
178inline int EBADRPC = 72;
179#pragma D binding "1.0" EBADRPC
180inline int ERPCMISMATCH = 73;
181#pragma D binding "1.0" ERPCMISMATCH
182inline int EPROGUNAVAIL = 74;
183#pragma D binding "1.0" EPROGUNAVAIL
184inline int EPROGMISMATCH = 75;
185#pragma D binding "1.0" EPROGMISMATCH
186inline int EPROCUNAVAIL = 76;
187#pragma D binding "1.0" EPROCUNAVAIL
188inline int ENOLCK = 77;
189#pragma D binding "1.0" ENOLCK
190inline int ENOSYS = 78;
191#pragma D binding "1.0" ENOSYS
192inline int EFTYPE = 79;
193#pragma D binding "1.0" EFTYPE
194inline int EAUTH = 80;
195#pragma D binding "1.0" EAUTH
196inline int ENEEDAUTH = 81;
197#pragma D binding "1.0" ENEEDAUTH
198inline int EIDRM = 82;
199#pragma D binding "1.0" EIDRM
200inline int ENOMSG = 83;
201#pragma D binding "1.0" ENOMSG
202inline int EOVERFLOW = 84;
203#pragma D binding "1.0" EOVERFLOW
204inline int ECANCELED = 85;
205#pragma D binding "1.0" ECANCELED
206inline int EILSEQ = 86;
207#pragma D binding "1.0" EILSEQ
208inline int ENOATTR = 87;
209#pragma D binding "1.0" ENOATTR
210inline int EDOOFUS = 88;
211#pragma D binding "1.0" EDOOFUS
212inline int EBADMSG = 89;
213#pragma D binding "1.0" EBADMSG
214inline int EMULTIHOP = 90;
215#pragma D binding "1.0" EMULTIHOP
216inline int ENOLINK = 91;
217#pragma D binding "1.0" ENOLINK
218inline int EPROTO = 92;
219#pragma D binding "1.0" EPROTO
220inline int ENOTCAPABLE = 93;
221#pragma D binding "1.13" ENOTCAPABLE
222inline int ECAPMODE = 94;
223#pragma D binding "1.13" ECAPMODE
224inline int ENOTRECOVERABLE = 95;
225#pragma D binding "1.13" ENOTRECOVERABLE
226inline int EOWNERDEAD = 96;
227#pragma D binding "1.13" EOWNERDEAD
228inline int ELAST = 96;
229#pragma D binding "1.0" ELAST
230inline int ERESTART = -1;
231#pragma D binding "1.0" ERESTART
232inline int EJUSTRETURN = -2;
233#pragma D binding "1.0" EJUSTRETURN
234inline int ENOIOCTL = -3;
235#pragma D binding "1.0" ENOIOCTL
236inline int EDIRIOCTL = -4;
237#pragma D binding "1.0" EDIRIOCTL
238inline int ERELOOKUP = -5;
239#pragma D binding "1.13" ERELOOKUP
240
241/*
242 * Error strings from <sys/errno.h>
243 */
244#pragma D binding "1.13" strerror
245inline string strerror[int errno] =
246	errno == 0 ? 			"Success" :
247	errno == EPERM ?		"Operation not permitted" :
248	errno == ENOENT ?		"No such file or directory" :
249	errno == ESRCH ?		"No such process" :
250	errno == EINTR ?		"Interrupted system call" :
251	errno == EIO ?			"Input/output error" :
252	errno == ENXIO ?		"Device not configured" :
253	errno == E2BIG ?		"Argument list too long" :
254	errno == ENOEXEC ?		"Exec format error" :
255	errno == EBADF ?		"Bad file descriptor" :
256	errno == ECHILD ?		"No child processes" :
257	errno == EDEADLK ?		"Resource deadlock avoided" :
258	errno == ENOMEM ?		"Cannot allocate memory" :
259	errno == EACCES ?		"Permission denied" :
260	errno == EFAULT ?		"Bad address" :
261	errno == ENOTBLK ?		"Block device required" :
262	errno == EBUSY ?		"Device busy" :
263	errno == EEXIST ?		"File exists" :
264	errno == EXDEV ?		"Cross-device link" :
265	errno == ENODEV ?		"Operation not supported by device" :
266	errno == ENOTDIR ?		"Not a directory" :
267	errno == EISDIR ?		"Is a directory" :
268	errno == EINVAL ?		"Invalid argument" :
269	errno == ENFILE ?		"Too many open files in system" :
270	errno == EMFILE ?		"Too many open files" :
271	errno == ENOTTY ?		"Inappropriate ioctl for device" :
272	errno == ETXTBSY ?		"Text file busy" :
273	errno == EFBIG ?		"File too large" :
274	errno == ENOSPC ?		"No space left on device" :
275	errno == ESPIPE ?		"Illegal seek" :
276	errno == EROFS ?		"Read-only filesystem" :
277	errno == EMLINK ?		"Too many links" :
278	errno == EPIPE ?		"Broken pipe" :
279	errno == EDOM ?			"Numerical argument out of domain" :
280	errno == ERANGE ?		"Result too large" :
281	errno == EAGAIN ?		"Resource temporarily unavailable" :
282	errno == EINPROGRESS ?		"Operation now in progress" :
283	errno == EALREADY ?		"Operation already in progress" :
284	errno == ENOTSOCK ?		"Socket operation on non-socket" :
285	errno == EDESTADDRREQ ?		"Destination address required" :
286	errno == EMSGSIZE ?		"Message too long" :
287	errno == EPROTOTYPE ?		"Protocol wrong type for socket" :
288	errno == ENOPROTOOPT ?		"Protocol not available" :
289	errno == EPROTONOSUPPORT ?	"Protocol not supported" :
290	errno == ESOCKTNOSUPPORT ?	"Socket type not supported" :
291	errno == EOPNOTSUPP ?		"Operation not supported" :
292	errno == EPFNOSUPPORT ?		"Protocol family not supported" :
293	errno == EAFNOSUPPORT ?		"Address family not supported by protocol family" :
294	errno == EADDRINUSE ?		"Address already in use" :
295	errno == EADDRNOTAVAIL ?	"Can't assign requested address" :
296	errno == ENETDOWN ?		"Network is down" :
297	errno == ENETUNREACH ?		"Network is unreachable" :
298	errno == ENETRESET ?		"Network dropped connection on reset" :
299	errno == ECONNABORTED ?		"Software caused connection abort" :
300	errno == ECONNRESET ?		"Connection reset by peer" :
301	errno == ENOBUFS ?		"No buffer space available" :
302	errno == EISCONN ?		"Socket is already connected" :
303	errno == ENOTCONN ?		"Socket is not connected" :
304	errno == ESHUTDOWN ?		"Can't send after socket shutdown" :
305	errno == ETOOMANYREFS ?		"Too many references: can't splice" :
306	errno == ETIMEDOUT ?		"Operation timed out" :
307	errno == ECONNREFUSED ?		"Connection refused" :
308	errno == ELOOP ?		"Too many levels of symbolic links" :
309	errno == ENAMETOOLONG ?		"File name too long" :
310	errno == EHOSTDOWN ?		"Host is down" :
311	errno == EHOSTUNREACH ?		"No route to host" :
312	errno == ENOTEMPTY ?		"Directory not empty" :
313	errno == EPROCLIM ?		"Too many processes" :
314	errno == EUSERS ?		"Too many users" :
315	errno == EDQUOT ?		"Disc quota exceeded" :
316	errno == ESTALE ?		"Stale NFS file handle" :
317	errno == EREMOTE ?		"Too many levels of remote in path" :
318	errno == EBADRPC ?		"RPC struct is bad" :
319	errno == ERPCMISMATCH ?		"RPC version wrong" :
320	errno == EPROGUNAVAIL ?		"RPC prog. not avail" :
321	errno == EPROGMISMATCH ?	"Program version wrong" :
322	errno == EPROCUNAVAIL ?		"Bad procedure for program" :
323	errno == ENOLCK ?		"No locks available" :
324	errno == ENOSYS ?		"Function not implemented" :
325	errno == EFTYPE ?		"Inappropriate file type or format" :
326	errno == EAUTH ?		"Authentication error" :
327	errno == ENEEDAUTH ?		"Need authenticator" :
328	errno == EIDRM ?		"Identifier removed" :
329	errno == ENOMSG ?		"No message of desired type" :
330	errno == EOVERFLOW ?		"Value too large to be stored in data type" :
331	errno == ECANCELED ?		"Operation canceled" :
332	errno == EILSEQ ?		"Illegal byte sequence" :
333	errno == ENOATTR ?		"Attribute not found" :
334	errno == EDOOFUS ?		"Programming error" :
335	errno == EBADMSG ?		"Bad message" :
336	errno == EMULTIHOP ?		"Multihop attempted" :
337	errno == ENOLINK ?		"Link has been severed" :
338	errno == EPROTO ?		"Protocol error" :
339	errno == ENOTCAPABLE ?		"Capabilities insufficient" :
340	errno == ECAPMODE ?		"Not permitted in capability mode" :
341	errno == ENOTRECOVERABLE ?	"State not recoverable" :
342	errno == EOWNERDEAD ?		"Previous owner died" :
343	errno == ERESTART ?		"restart syscall" :
344	errno == EJUSTRETURN ?		"don't modify regs, just return" :
345	errno == ENOIOCTL ?		"ioctl not handled by this layer" :
346	errno == EDIRIOCTL ?		"do direct ioctl in GEOM" :
347	errno == ERELOOKUP ?		"retry the directory lookup" :
348	"Unknown error";
349