compat_errlist.c revision 1.2 1 1.2 cbiere /* $NetBSD: compat_errlist.c,v 1.2 2006/10/31 00:38:07 cbiere Exp $ */
2 1.1 christos
3 1.1 christos /*
4 1.1 christos * Copyright (c) 1982, 1985, 1993
5 1.1 christos * The Regents of the University of California. All rights reserved.
6 1.1 christos *
7 1.1 christos * Redistribution and use in source and binary forms, with or without
8 1.1 christos * modification, are permitted provided that the following conditions
9 1.1 christos * are met:
10 1.1 christos * 1. Redistributions of source code must retain the above copyright
11 1.1 christos * notice, this list of conditions and the following disclaimer.
12 1.1 christos * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 christos * notice, this list of conditions and the following disclaimer in the
14 1.1 christos * documentation and/or other materials provided with the distribution.
15 1.1 christos * 3. Neither the name of the University nor the names of its contributors
16 1.1 christos * may be used to endorse or promote products derived from this software
17 1.1 christos * without specific prior written permission.
18 1.1 christos *
19 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 1.1 christos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.1 christos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.1 christos * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 1.1 christos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.1 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.1 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.1 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1 christos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.1 christos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.1 christos * SUCH DAMAGE.
30 1.1 christos */
31 1.1 christos
32 1.1 christos #include <sys/cdefs.h>
33 1.1 christos #if defined(LIBC_SCCS) && !defined(lint)
34 1.1 christos #if 0
35 1.1 christos static char sccsid[] = "@(#)errlst.c 8.2 (Berkeley) 11/16/93";
36 1.1 christos #else
37 1.2 cbiere __RCSID("$NetBSD: compat_errlist.c,v 1.2 2006/10/31 00:38:07 cbiere Exp $");
38 1.1 christos #endif
39 1.1 christos #endif /* LIBC_SCCS and not lint */
40 1.1 christos
41 1.1 christos #include "namespace.h"
42 1.1 christos
43 1.1 christos #define __LIBC12_SOURCE__
44 1.1 christos #include <errno.h>
45 1.1 christos #ifdef __weak_alias
46 1.1 christos __weak_alias(sys_errlist, _sys_errlist)
47 1.1 christos __weak_alias(__sys_errlist, _sys_errlist)
48 1.1 christos __weak_alias(sys_nerr, _sys_nerr)
49 1.1 christos __weak_alias(__sys_nerr, _sys_nerr)
50 1.1 christos #endif
51 1.1 christos
52 1.1 christos const char *const sys_errlist[] = {
53 1.1 christos "Undefined error: 0", /* 0 - ENOERROR */
54 1.1 christos "Operation not permitted", /* 1 - EPERM */
55 1.1 christos "No such file or directory", /* 2 - ENOENT */
56 1.1 christos "No such process", /* 3 - ESRCH */
57 1.1 christos "Interrupted system call", /* 4 - EINTR */
58 1.1 christos "Input/output error", /* 5 - EIO */
59 1.1 christos "Device not configured", /* 6 - ENXIO */
60 1.1 christos "Argument list too long", /* 7 - E2BIG */
61 1.1 christos "Exec format error", /* 8 - ENOEXEC */
62 1.1 christos "Bad file descriptor", /* 9 - EBADF */
63 1.1 christos "No child processes", /* 10 - ECHILD */
64 1.1 christos "Resource deadlock avoided", /* 11 - EDEADLK */
65 1.1 christos "Cannot allocate memory", /* 12 - ENOMEM */
66 1.1 christos "Permission denied", /* 13 - EACCES */
67 1.1 christos "Bad address", /* 14 - EFAULT */
68 1.1 christos "Block device required", /* 15 - ENOTBLK */
69 1.1 christos "Device busy", /* 16 - EBUSY */
70 1.1 christos "File exists", /* 17 - EEXIST */
71 1.1 christos "Cross-device link", /* 18 - EXDEV */
72 1.1 christos "Operation not supported by device", /* 19 - ENODEV */
73 1.1 christos "Not a directory", /* 20 - ENOTDIR */
74 1.1 christos "Is a directory", /* 21 - EISDIR */
75 1.1 christos "Invalid argument", /* 22 - EINVAL */
76 1.1 christos "Too many open files in system", /* 23 - ENFILE */
77 1.1 christos "Too many open files", /* 24 - EMFILE */
78 1.1 christos "Inappropriate ioctl for device", /* 25 - ENOTTY */
79 1.1 christos "Text file busy", /* 26 - ETXTBSY */
80 1.1 christos "File too large", /* 27 - EFBIG */
81 1.1 christos "No space left on device", /* 28 - ENOSPC */
82 1.1 christos "Illegal seek", /* 29 - ESPIPE */
83 1.1 christos "Read-only file system", /* 30 - EROFS */
84 1.1 christos "Too many links", /* 31 - EMLINK */
85 1.1 christos "Broken pipe", /* 32 - EPIPE */
86 1.1 christos
87 1.1 christos /* math software */
88 1.1 christos "Numerical argument out of domain", /* 33 - EDOM */
89 1.1 christos "Result too large or too small", /* 34 - ERANGE */
90 1.1 christos
91 1.1 christos /* non-blocking and interrupt i/o */
92 1.1 christos "Resource temporarily unavailable", /* 35 - EAGAIN */
93 1.1 christos /* 35 - EWOULDBLOCK */
94 1.1 christos "Operation now in progress", /* 36 - EINPROGRESS */
95 1.1 christos "Operation already in progress", /* 37 - EALREADY */
96 1.1 christos
97 1.1 christos /* ipc/network software -- argument errors */
98 1.1 christos "Socket operation on non-socket", /* 38 - ENOTSOCK */
99 1.1 christos "Destination address required", /* 39 - EDESTADDRREQ */
100 1.1 christos "Message too long", /* 40 - EMSGSIZE */
101 1.1 christos "Protocol wrong type for socket", /* 41 - EPROTOTYPE */
102 1.2 cbiere "Protocol option not available", /* 42 - ENOPROTOOPT */
103 1.1 christos "Protocol not supported", /* 43 - EPROTONOSUPPORT */
104 1.1 christos "Socket type not supported", /* 44 - ESOCKTNOSUPPORT */
105 1.1 christos "Operation not supported", /* 45 - EOPNOTSUPP */
106 1.1 christos "Protocol family not supported", /* 46 - EPFNOSUPPORT */
107 1.1 christos /* 47 - EAFNOSUPPORT */
108 1.1 christos "Address family not supported by protocol family",
109 1.1 christos "Address already in use", /* 48 - EADDRINUSE */
110 1.1 christos "Can't assign requested address", /* 49 - EADDRNOTAVAIL */
111 1.1 christos
112 1.1 christos /* ipc/network software -- operational errors */
113 1.1 christos "Network is down", /* 50 - ENETDOWN */
114 1.1 christos "Network is unreachable", /* 51 - ENETUNREACH */
115 1.1 christos "Network dropped connection on reset", /* 52 - ENETRESET */
116 1.1 christos "Software caused connection abort", /* 53 - ECONNABORTED */
117 1.1 christos "Connection reset by peer", /* 54 - ECONNRESET */
118 1.1 christos "No buffer space available", /* 55 - ENOBUFS */
119 1.1 christos "Socket is already connected", /* 56 - EISCONN */
120 1.1 christos "Socket is not connected", /* 57 - ENOTCONN */
121 1.1 christos "Can't send after socket shutdown", /* 58 - ESHUTDOWN */
122 1.1 christos "Too many references: can't splice", /* 59 - ETOOMANYREFS */
123 1.1 christos "Operation timed out", /* 60 - ETIMEDOUT */
124 1.1 christos "Connection refused", /* 61 - ECONNREFUSED */
125 1.1 christos
126 1.1 christos "Too many levels of symbolic links", /* 62 - ELOOP */
127 1.1 christos "File name too long", /* 63 - ENAMETOOLONG */
128 1.1 christos
129 1.1 christos /* should be rearranged */
130 1.1 christos "Host is down", /* 64 - EHOSTDOWN */
131 1.1 christos "No route to host", /* 65 - EHOSTUNREACH */
132 1.1 christos "Directory not empty", /* 66 - ENOTEMPTY */
133 1.1 christos
134 1.1 christos /* quotas & mush */
135 1.1 christos "Too many processes", /* 67 - EPROCLIM */
136 1.1 christos "Too many users", /* 68 - EUSERS */
137 1.1 christos "Disc quota exceeded", /* 69 - EDQUOT */
138 1.1 christos
139 1.1 christos /* Network File System */
140 1.1 christos "Stale NFS file handle", /* 70 - ESTALE */
141 1.1 christos "Too many levels of remote in path", /* 71 - EREMOTE */
142 1.1 christos "RPC struct is bad", /* 72 - EBADRPC */
143 1.1 christos "RPC version wrong", /* 73 - ERPCMISMATCH */
144 1.1 christos "RPC prog. not avail", /* 74 - EPROGUNAVAIL */
145 1.1 christos "Program version wrong", /* 75 - EPROGMISMATCH */
146 1.1 christos "Bad procedure for program", /* 76 - EPROCUNAVAIL */
147 1.1 christos
148 1.1 christos "No locks available", /* 77 - ENOLCK */
149 1.1 christos "Function not implemented", /* 78 - ENOSYS */
150 1.1 christos
151 1.1 christos "Inappropriate file type or format", /* 79 - EFTYPE */
152 1.1 christos };
153 1.1 christos const int sys_nerr = { sizeof(sys_errlist) / sizeof(sys_errlist[0]) };
154