]>
Commit | Line | Data |
---|---|---|
e9ce8d39 A |
1 | /* |
2 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
734aad71 | 6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. |
e9ce8d39 | 7 | * |
734aad71 A |
8 | * This file contains Original Code and/or Modifications of Original Code |
9 | * as defined in and that are subject to the Apple Public Source License | |
10 | * Version 2.0 (the 'License'). You may not use this file except in | |
11 | * compliance with the License. Please obtain a copy of the License at | |
12 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
13 | * file. | |
14 | * | |
15 | * The Original Code and all software distributed under the License are | |
16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
e9ce8d39 A |
17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
734aad71 A |
19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
20 | * Please see the License for the specific language governing rights and | |
21 | * limitations under the License. | |
e9ce8d39 A |
22 | * |
23 | * @APPLE_LICENSE_HEADER_END@ | |
24 | */ | |
25 | /* | |
26 | * Copyright (c) 1982, 1985, 1993 | |
27 | * The Regents of the University of California. All rights reserved. | |
28 | * | |
29 | * Redistribution and use in source and binary forms, with or without | |
30 | * modification, are permitted provided that the following conditions | |
31 | * are met: | |
32 | * 1. Redistributions of source code must retain the above copyright | |
33 | * notice, this list of conditions and the following disclaimer. | |
34 | * 2. Redistributions in binary form must reproduce the above copyright | |
35 | * notice, this list of conditions and the following disclaimer in the | |
36 | * documentation and/or other materials provided with the distribution. | |
37 | * 3. All advertising materials mentioning features or use of this software | |
38 | * must display the following acknowledgement: | |
39 | * This product includes software developed by the University of | |
40 | * California, Berkeley and its contributors. | |
41 | * 4. Neither the name of the University nor the names of its contributors | |
42 | * may be used to endorse or promote products derived from this software | |
43 | * without specific prior written permission. | |
44 | * | |
45 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
46 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
47 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
48 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
49 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
50 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
51 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
52 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
53 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
54 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
55 | * SUCH DAMAGE. | |
56 | */ | |
57 | ||
58 | ||
59 | #include <stdio.h> | |
60 | ||
61 | const char *const sys_errlist[] = { | |
62 | "Undefined error: 0", /* 0 - ENOERROR */ | |
63 | "Operation not permitted", /* 1 - EPERM */ | |
64 | "No such file or directory", /* 2 - ENOENT */ | |
65 | "No such process", /* 3 - ESRCH */ | |
66 | "Interrupted system call", /* 4 - EINTR */ | |
67 | "Input/output error", /* 5 - EIO */ | |
68 | "Device not configured", /* 6 - ENXIO */ | |
69 | "Argument list too long", /* 7 - E2BIG */ | |
70 | "Exec format error", /* 8 - ENOEXEC */ | |
71 | "Bad file descriptor", /* 9 - EBADF */ | |
72 | "No child processes", /* 10 - ECHILD */ | |
73 | "Resource deadlock avoided", /* 11 - EDEADLK */ | |
74 | "Cannot allocate memory", /* 12 - ENOMEM */ | |
75 | "Permission denied", /* 13 - EACCES */ | |
76 | "Bad address", /* 14 - EFAULT */ | |
77 | "Block device required", /* 15 - ENOTBLK */ | |
78 | "Device busy", /* 16 - EBUSY */ | |
79 | "File exists", /* 17 - EEXIST */ | |
80 | "Cross-device link", /* 18 - EXDEV */ | |
81 | "Operation not supported by device", /* 19 - ENODEV */ | |
82 | "Not a directory", /* 20 - ENOTDIR */ | |
83 | "Is a directory", /* 21 - EISDIR */ | |
84 | "Invalid argument", /* 22 - EINVAL */ | |
85 | "Too many open files in system", /* 23 - ENFILE */ | |
86 | "Too many open files", /* 24 - EMFILE */ | |
87 | "Inappropriate ioctl for device", /* 25 - ENOTTY */ | |
88 | "Text file busy", /* 26 - ETXTBSY */ | |
89 | "File too large", /* 27 - EFBIG */ | |
90 | "No space left on device", /* 28 - ENOSPC */ | |
91 | "Illegal seek", /* 29 - ESPIPE */ | |
92 | "Read-only file system", /* 30 - EROFS */ | |
93 | "Too many links", /* 31 - EMLINK */ | |
94 | "Broken pipe", /* 32 - EPIPE */ | |
95 | ||
96 | /* math software */ | |
97 | "Numerical argument out of domain", /* 33 - EDOM */ | |
98 | "Result too large", /* 34 - ERANGE */ | |
99 | ||
100 | /* non-blocking and interrupt i/o */ | |
101 | "Resource temporarily unavailable", /* 35 - EAGAIN */ | |
102 | /* 35 - EWOULDBLOCK */ | |
103 | "Operation now in progress", /* 36 - EINPROGRESS */ | |
104 | "Operation already in progress", /* 37 - EALREADY */ | |
105 | ||
106 | /* ipc/network software -- argument errors */ | |
107 | "Socket operation on non-socket", /* 38 - ENOTSOCK */ | |
108 | "Destination address required", /* 39 - EDESTADDRREQ */ | |
109 | "Message too long", /* 40 - EMSGSIZE */ | |
110 | "Protocol wrong type for socket", /* 41 - EPROTOTYPE */ | |
111 | "Protocol not available", /* 42 - ENOPROTOOPT */ | |
112 | "Protocol not supported", /* 43 - EPROTONOSUPPORT */ | |
113 | "Socket type not supported", /* 44 - ESOCKTNOSUPPORT */ | |
114 | "Operation not supported", /* 45 - EOPNOTSUPP */ | |
115 | "Protocol family not supported", /* 46 - EPFNOSUPPORT */ | |
116 | /* 47 - EAFNOSUPPORT */ | |
117 | "Address family not supported by protocol family", | |
118 | "Address already in use", /* 48 - EADDRINUSE */ | |
119 | "Can't assign requested address", /* 49 - EADDRNOTAVAIL */ | |
120 | ||
121 | /* ipc/network software -- operational errors */ | |
122 | "Network is down", /* 50 - ENETDOWN */ | |
123 | "Network is unreachable", /* 51 - ENETUNREACH */ | |
124 | "Network dropped connection on reset", /* 52 - ENETRESET */ | |
125 | "Software caused connection abort", /* 53 - ECONNABORTED */ | |
126 | "Connection reset by peer", /* 54 - ECONNRESET */ | |
127 | "No buffer space available", /* 55 - ENOBUFS */ | |
128 | "Socket is already connected", /* 56 - EISCONN */ | |
129 | "Socket is not connected", /* 57 - ENOTCONN */ | |
130 | "Can't send after socket shutdown", /* 58 - ESHUTDOWN */ | |
131 | "Too many references: can't splice", /* 59 - ETOOMANYREFS */ | |
132 | "Operation timed out", /* 60 - ETIMEDOUT */ | |
133 | "Connection refused", /* 61 - ECONNREFUSED */ | |
134 | ||
135 | "Too many levels of symbolic links", /* 62 - ELOOP */ | |
136 | "File name too long", /* 63 - ENAMETOOLONG */ | |
137 | ||
138 | /* should be rearranged */ | |
139 | "Host is down", /* 64 - EHOSTDOWN */ | |
140 | "No route to host", /* 65 - EHOSTUNREACH */ | |
141 | "Directory not empty", /* 66 - ENOTEMPTY */ | |
142 | ||
143 | /* quotas & mush */ | |
144 | "Too many processes", /* 67 - EPROCLIM */ | |
145 | "Too many users", /* 68 - EUSERS */ | |
146 | "Disc quota exceeded", /* 69 - EDQUOT */ | |
147 | ||
148 | /* Network File System */ | |
149 | "Stale NFS file handle", /* 70 - ESTALE */ | |
150 | "Too many levels of remote in path", /* 71 - EREMOTE */ | |
151 | "RPC struct is bad", /* 72 - EBADRPC */ | |
152 | "RPC version wrong", /* 73 - ERPCMISMATCH */ | |
153 | "RPC prog. not avail", /* 74 - EPROGUNAVAIL */ | |
154 | "Program version wrong", /* 75 - EPROGMISMATCH */ | |
155 | "Bad procedure for program", /* 76 - EPROCUNAVAIL */ | |
156 | ||
157 | "No locks available", /* 77 - ENOLCK */ | |
158 | "Function not implemented", /* 78 - ENOSYS */ | |
159 | "Inappropriate file type or format", /* 79 - EFTYPE */ | |
160 | "Authentication error", /* 80 - EAUTH */ | |
161 | "Need authenticator", /* 81 - ENEEDAUTH */ | |
162 | ||
163 | "Device power is off", /* 82 - EPWROFF */ | |
164 | "Device error", /* 83 - EDEVERR */ | |
165 | "Value too large to be stored in data type", /* 84 - EOVERFLOW */ | |
166 | ||
167 | /* program loading errors */ | |
168 | "Bad executable (or shared library)", /* 85 - EBADEXEC */ | |
169 | "Bad CPU type in executable", /* 86 - EBADARCH */ | |
170 | "Shared library version mismatch", /* 87 - ESHLIBVERS */ | |
171 | "Malformed Mach-o file" /* 88 - EBADMACHO */ | |
172 | }; | |
173 | ||
174 | int errno; | |
175 | ||
176 | const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); |