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