1/*	$OpenBSD: errlist.c,v 1.19 2017/09/05 03:06:26 jsg Exp $ */
2/*
3 * Copyright (c) 1982, 1985, 1993
4 *	The Regents of the University of California.  All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 *    notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 *    notice, this list of conditions and the following disclaimer in the
13 *    documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of the University nor the names of its contributors
15 *    may be used to endorse or promote products derived from this software
16 *    without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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#include <errno.h>
32
33const char *const sys_errlist[] = {
34	"Undefined error: 0",			/*  0 - ENOERROR */
35	"Operation not permitted",		/*  1 - EPERM */
36	"No such file or directory",		/*  2 - ENOENT */
37	"No such process",			/*  3 - ESRCH */
38	"Interrupted system call",		/*  4 - EINTR */
39	"Input/output error",			/*  5 - EIO */
40	"Device not configured",		/*  6 - ENXIO */
41	"Argument list too long",		/*  7 - E2BIG */
42	"Exec format error",			/*  8 - ENOEXEC */
43	"Bad file descriptor",			/*  9 - EBADF */
44	"No child processes",			/* 10 - ECHILD */
45	"Resource deadlock avoided",		/* 11 - EDEADLK */
46	"Cannot allocate memory",		/* 12 - ENOMEM */
47	"Permission denied",			/* 13 - EACCES */
48	"Bad address",				/* 14 - EFAULT */
49	"Block device required",		/* 15 - ENOTBLK */
50	"Device busy",				/* 16 - EBUSY */
51	"File exists",				/* 17 - EEXIST */
52	"Cross-device link",			/* 18 - EXDEV */
53	"Operation not supported by device",	/* 19 - ENODEV */
54	"Not a directory",			/* 20 - ENOTDIR */
55	"Is a directory",			/* 21 - EISDIR */
56	"Invalid argument",			/* 22 - EINVAL */
57	"Too many open files in system",	/* 23 - ENFILE */
58	"Too many open files",			/* 24 - EMFILE */
59	"Inappropriate ioctl for device",	/* 25 - ENOTTY */
60	"Text file busy",			/* 26 - ETXTBSY */
61	"File too large",			/* 27 - EFBIG */
62	"No space left on device",		/* 28 - ENOSPC */
63	"Illegal seek",				/* 29 - ESPIPE */
64	"Read-only file system",		/* 30 - EROFS */
65	"Too many links",			/* 31 - EMLINK */
66	"Broken pipe",				/* 32 - EPIPE */
67
68/* math software */
69	"Numerical argument out of domain",	/* 33 - EDOM */
70	"Result too large",			/* 34 - ERANGE */
71
72/* non-blocking and interrupt i/o */
73	"Resource temporarily unavailable",	/* 35 - EAGAIN */
74						/* 35 - EWOULDBLOCK */
75	"Operation now in progress",		/* 36 - EINPROGRESS */
76	"Operation already in progress",	/* 37 - EALREADY */
77
78/* ipc/network software -- argument errors */
79	"Socket operation on non-socket",	/* 38 - ENOTSOCK */
80	"Destination address required",		/* 39 - EDESTADDRREQ */
81	"Message too long",			/* 40 - EMSGSIZE */
82	"Protocol wrong type for socket",	/* 41 - EPROTOTYPE */
83	"Protocol not available",		/* 42 - ENOPROTOOPT */
84	"Protocol not supported",		/* 43 - EPROTONOSUPPORT */
85	"Socket type not supported",		/* 44 - ESOCKTNOSUPPORT */
86	"Operation not supported",		/* 45 - EOPNOTSUPP */
87	"Protocol family not supported",	/* 46 - EPFNOSUPPORT */
88						/* 47 - EAFNOSUPPORT */
89	"Address family not supported by protocol family",
90	"Address already in use",		/* 48 - EADDRINUSE */
91	"Can't assign requested address",	/* 49 - EADDRNOTAVAIL */
92
93/* ipc/network software -- operational errors */
94	"Network is down",			/* 50 - ENETDOWN */
95	"Network is unreachable",		/* 51 - ENETUNREACH */
96	"Network dropped connection on reset",	/* 52 - ENETRESET */
97	"Software caused connection abort",	/* 53 - ECONNABORTED */
98	"Connection reset by peer",		/* 54 - ECONNRESET */
99	"No buffer space available",		/* 55 - ENOBUFS */
100	"Socket is already connected",		/* 56 - EISCONN */
101	"Socket is not connected",		/* 57 - ENOTCONN */
102	"Can't send after socket shutdown",	/* 58 - ESHUTDOWN */
103	"Too many references: can't splice",	/* 59 - ETOOMANYREFS */
104	"Operation timed out",			/* 60 - ETIMEDOUT */
105	"Connection refused",			/* 61 - ECONNREFUSED */
106
107	"Too many levels of symbolic links",	/* 62 - ELOOP */
108	"File name too long",			/* 63 - ENAMETOOLONG */
109
110/* should be rearranged */
111	"Host is down",				/* 64 - EHOSTDOWN */
112	"No route to host",			/* 65 - EHOSTUNREACH */
113	"Directory not empty",			/* 66 - ENOTEMPTY */
114
115/* quotas & mush */
116	"Too many processes",			/* 67 - EPROCLIM */
117	"Too many users",			/* 68 - EUSERS */
118	"Disk quota exceeded",			/* 69 - EDQUOT */
119
120/* Network File System */
121	"Stale NFS file handle",		/* 70 - ESTALE */
122	"Too many levels of remote in path",	/* 71 - EREMOTE */
123	"RPC struct is bad",			/* 72 - EBADRPC */
124	"RPC version wrong",			/* 73 - ERPCMISMATCH */
125	"RPC program not available",		/* 74 - EPROGUNAVAIL */
126	"Program version wrong",		/* 75 - EPROGMISMATCH */
127	"Bad procedure for program",		/* 76 - EPROCUNAVAIL */
128
129	"No locks available",			/* 77 - ENOLCK */
130	"Function not implemented",		/* 78 - ENOSYS */
131	"Inappropriate file type or format",	/* 79 - EFTYPE */
132	"Authentication error",			/* 80 - EAUTH */
133	"Need authenticator",			/* 81 - ENEEDAUTH */
134	"IPsec processing failure",		/* 82 - EIPSEC */
135	"Attribute not found",			/* 83 - ENOATTR */
136	"Illegal byte sequence",		/* 84 - EILSEQ */
137	"No medium found",			/* 85 - ENOMEDIUM */
138	"Wrong medium type",			/* 86 - EMEDIUMTYPE */
139						/* 87 - EOVERFLOW */
140	"Value too large to be stored in data type",
141	"Operation canceled",			/* 88 - ECANCELED */
142	"Identifier removed",			/* 89 - EIDRM */
143	"No message of desired type",		/* 90 - ENOMSG */
144	"Not supported",			/* 91 - ENOTSUP */
145	"Bad message",				/* 92 - EBADMSG */
146	"State not recoverable",		/* 93 - ENOTRECOVERABLE */
147	"Previous owner died",			/* 94 - EOWNERDEAD */
148	"Protocol error",			/* 95 - EPROTO */
149};
150const int sys_nerr = { sizeof sys_errlist/sizeof sys_errlist[0] };
151#if 0
152DEF_WEAK(sys_errlist);
153DEF_WEAK(sys_nerr);
154#endif
155
156__strong_alias(_sys_errlist, sys_errlist);
157__strong_alias(_sys_nerr, sys_nerr);
158