annotate lib/strerror.c @ 272:d5392bb5da3c 2.5

Added generated files
author lost
date Sun, 16 Aug 2009 17:16:49 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
272
d5392bb5da3c Added generated files
lost
parents:
diff changeset
1 /* strerror.c --- POSIX compatible system error routine
d5392bb5da3c Added generated files
lost
parents:
diff changeset
2
d5392bb5da3c Added generated files
lost
parents:
diff changeset
3 Copyright (C) 2007-2008 Free Software Foundation, Inc.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
4
d5392bb5da3c Added generated files
lost
parents:
diff changeset
5 This program is free software: you can redistribute it and/or modify
d5392bb5da3c Added generated files
lost
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
d5392bb5da3c Added generated files
lost
parents:
diff changeset
7 the Free Software Foundation; either version 3 of the License, or
d5392bb5da3c Added generated files
lost
parents:
diff changeset
8 (at your option) any later version.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
9
d5392bb5da3c Added generated files
lost
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
d5392bb5da3c Added generated files
lost
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d5392bb5da3c Added generated files
lost
parents:
diff changeset
13 GNU General Public License for more details.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
14
d5392bb5da3c Added generated files
lost
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
d5392bb5da3c Added generated files
lost
parents:
diff changeset
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
17
d5392bb5da3c Added generated files
lost
parents:
diff changeset
18 #include <config.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
19
d5392bb5da3c Added generated files
lost
parents:
diff changeset
20 #include <string.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
21
d5392bb5da3c Added generated files
lost
parents:
diff changeset
22 #if REPLACE_STRERROR
d5392bb5da3c Added generated files
lost
parents:
diff changeset
23
d5392bb5da3c Added generated files
lost
parents:
diff changeset
24 # include <errno.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
25 # include <stdio.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
26
d5392bb5da3c Added generated files
lost
parents:
diff changeset
27 # if GNULIB_defined_ESOCK /* native Windows platforms */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
28 # if HAVE_WINSOCK2_H
d5392bb5da3c Added generated files
lost
parents:
diff changeset
29 # include <winsock2.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
30 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
31 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
32
d5392bb5da3c Added generated files
lost
parents:
diff changeset
33 # include "intprops.h"
d5392bb5da3c Added generated files
lost
parents:
diff changeset
34
d5392bb5da3c Added generated files
lost
parents:
diff changeset
35 # undef strerror
d5392bb5da3c Added generated files
lost
parents:
diff changeset
36 # if ! HAVE_DECL_STRERROR
d5392bb5da3c Added generated files
lost
parents:
diff changeset
37 # define strerror(n) NULL
d5392bb5da3c Added generated files
lost
parents:
diff changeset
38 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
39
d5392bb5da3c Added generated files
lost
parents:
diff changeset
40 char *
d5392bb5da3c Added generated files
lost
parents:
diff changeset
41 rpl_strerror (int n)
d5392bb5da3c Added generated files
lost
parents:
diff changeset
42 {
d5392bb5da3c Added generated files
lost
parents:
diff changeset
43 /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
44 switch (n)
d5392bb5da3c Added generated files
lost
parents:
diff changeset
45 {
d5392bb5da3c Added generated files
lost
parents:
diff changeset
46 # if GNULIB_defined_ETXTBSY
d5392bb5da3c Added generated files
lost
parents:
diff changeset
47 case ETXTBSY:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
48 return "Text file busy";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
49 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
50
d5392bb5da3c Added generated files
lost
parents:
diff changeset
51 # if GNULIB_defined_ESOCK /* native Windows platforms */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
52 /* EWOULDBLOCK is the same as EAGAIN. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
53 case EINPROGRESS:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
54 return "Operation now in progress";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
55 case EALREADY:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
56 return "Operation already in progress";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
57 case ENOTSOCK:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
58 return "Socket operation on non-socket";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
59 case EDESTADDRREQ:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
60 return "Destination address required";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
61 case EMSGSIZE:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
62 return "Message too long";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
63 case EPROTOTYPE:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
64 return "Protocol wrong type for socket";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
65 case ENOPROTOOPT:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
66 return "Protocol not available";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
67 case EPROTONOSUPPORT:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
68 return "Protocol not supported";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
69 case ESOCKTNOSUPPORT:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
70 return "Socket type not supported";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
71 case EOPNOTSUPP:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
72 return "Operation not supported";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
73 case EPFNOSUPPORT:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
74 return "Protocol family not supported";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
75 case EAFNOSUPPORT:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
76 return "Address family not supported by protocol";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
77 case EADDRINUSE:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
78 return "Address already in use";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
79 case EADDRNOTAVAIL:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
80 return "Cannot assign requested address";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
81 case ENETDOWN:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
82 return "Network is down";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
83 case ENETUNREACH:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
84 return "Network is unreachable";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
85 case ENETRESET:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
86 return "Network dropped connection on reset";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
87 case ECONNABORTED:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
88 return "Software caused connection abort";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
89 case ECONNRESET:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
90 return "Connection reset by peer";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
91 case ENOBUFS:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
92 return "No buffer space available";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
93 case EISCONN:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
94 return "Transport endpoint is already connected";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
95 case ENOTCONN:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
96 return "Transport endpoint is not connected";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
97 case ESHUTDOWN:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
98 return "Cannot send after transport endpoint shutdown";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
99 case ETOOMANYREFS:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
100 return "Too many references: cannot splice";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
101 case ETIMEDOUT:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
102 return "Connection timed out";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
103 case ECONNREFUSED:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
104 return "Connection refused";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
105 case ELOOP:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
106 return "Too many levels of symbolic links";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
107 case EHOSTDOWN:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
108 return "Host is down";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
109 case EHOSTUNREACH:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
110 return "No route to host";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
111 case EPROCLIM:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
112 return "Too many processes";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
113 case EUSERS:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
114 return "Too many users";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
115 case EDQUOT:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
116 return "Disk quota exceeded";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
117 case ESTALE:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
118 return "Stale NFS file handle";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
119 case EREMOTE:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
120 return "Object is remote";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
121 # if HAVE_WINSOCK2_H
d5392bb5da3c Added generated files
lost
parents:
diff changeset
122 /* WSA_INVALID_HANDLE maps to EBADF */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
123 /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
124 /* WSA_INVALID_PARAMETER maps to EINVAL */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
125 case WSA_OPERATION_ABORTED:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
126 return "Overlapped operation aborted";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
127 case WSA_IO_INCOMPLETE:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
128 return "Overlapped I/O event object not in signaled state";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
129 case WSA_IO_PENDING:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
130 return "Overlapped operations will complete later";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
131 /* WSAEINTR maps to EINTR */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
132 /* WSAEBADF maps to EBADF */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
133 /* WSAEACCES maps to EACCES */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
134 /* WSAEFAULT maps to EFAULT */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
135 /* WSAEINVAL maps to EINVAL */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
136 /* WSAEMFILE maps to EMFILE */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
137 /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
138 /* WSAEINPROGRESS is EINPROGRESS */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
139 /* WSAEALREADY is EALREADY */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
140 /* WSAENOTSOCK is ENOTSOCK */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
141 /* WSAEDESTADDRREQ is EDESTADDRREQ */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
142 /* WSAEMSGSIZE is EMSGSIZE */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
143 /* WSAEPROTOTYPE is EPROTOTYPE */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
144 /* WSAENOPROTOOPT is ENOPROTOOPT */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
145 /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
146 /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
147 /* WSAEOPNOTSUPP is EOPNOTSUPP */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
148 /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
149 /* WSAEAFNOSUPPORT is EAFNOSUPPORT */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
150 /* WSAEADDRINUSE is EADDRINUSE */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
151 /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
152 /* WSAENETDOWN is ENETDOWN */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
153 /* WSAENETUNREACH is ENETUNREACH */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
154 /* WSAENETRESET is ENETRESET */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
155 /* WSAECONNABORTED is ECONNABORTED */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
156 /* WSAECONNRESET is ECONNRESET */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
157 /* WSAENOBUFS is ENOBUFS */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
158 /* WSAEISCONN is EISCONN */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
159 /* WSAENOTCONN is ENOTCONN */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
160 /* WSAESHUTDOWN is ESHUTDOWN */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
161 /* WSAETOOMANYREFS is ETOOMANYREFS */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
162 /* WSAETIMEDOUT is ETIMEDOUT */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
163 /* WSAECONNREFUSED is ECONNREFUSED */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
164 /* WSAELOOP is ELOOP */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
165 /* WSAENAMETOOLONG maps to ENAMETOOLONG */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
166 /* WSAEHOSTDOWN is EHOSTDOWN */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
167 /* WSAEHOSTUNREACH is EHOSTUNREACH */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
168 /* WSAENOTEMPTY maps to ENOTEMPTY */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
169 /* WSAEPROCLIM is EPROCLIM */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
170 /* WSAEUSERS is EUSERS */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
171 /* WSAEDQUOT is EDQUOT */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
172 /* WSAESTALE is ESTALE */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
173 /* WSAEREMOTE is EREMOTE */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
174 case WSASYSNOTREADY:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
175 return "Network subsystem is unavailable";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
176 case WSAVERNOTSUPPORTED:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
177 return "Winsock.dll version out of range";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
178 case WSANOTINITIALISED:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
179 return "Successful WSAStartup not yet performed";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
180 case WSAEDISCON:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
181 return "Graceful shutdown in progress";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
182 case WSAENOMORE: case WSA_E_NO_MORE:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
183 return "No more results";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
184 case WSAECANCELLED: case WSA_E_CANCELLED:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
185 return "Call was canceled";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
186 case WSAEINVALIDPROCTABLE:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
187 return "Procedure call table is invalid";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
188 case WSAEINVALIDPROVIDER:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
189 return "Service provider is invalid";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
190 case WSAEPROVIDERFAILEDINIT:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
191 return "Service provider failed to initialize";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
192 case WSASYSCALLFAILURE:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
193 return "System call failure";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
194 case WSASERVICE_NOT_FOUND:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
195 return "Service not found";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
196 case WSATYPE_NOT_FOUND:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
197 return "Class type not found";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
198 case WSAEREFUSED:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
199 return "Database query was refused";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
200 case WSAHOST_NOT_FOUND:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
201 return "Host not found";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
202 case WSATRY_AGAIN:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
203 return "Nonauthoritative host not found";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
204 case WSANO_RECOVERY:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
205 return "Nonrecoverable error";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
206 case WSANO_DATA:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
207 return "Valid name, no data record of requested type";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
208 /* WSA_QOS_* omitted */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
209 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
210 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
211
d5392bb5da3c Added generated files
lost
parents:
diff changeset
212 # if GNULIB_defined_ENOMSG
d5392bb5da3c Added generated files
lost
parents:
diff changeset
213 case ENOMSG:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
214 return "No message of desired type";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
215 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
216
d5392bb5da3c Added generated files
lost
parents:
diff changeset
217 # if GNULIB_defined_EIDRM
d5392bb5da3c Added generated files
lost
parents:
diff changeset
218 case EIDRM:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
219 return "Identifier removed";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
220 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
221
d5392bb5da3c Added generated files
lost
parents:
diff changeset
222 # if GNULIB_defined_ENOLINK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
223 case ENOLINK:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
224 return "Link has been severed";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
225 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
226
d5392bb5da3c Added generated files
lost
parents:
diff changeset
227 # if GNULIB_defined_EPROTO
d5392bb5da3c Added generated files
lost
parents:
diff changeset
228 case EPROTO:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
229 return "Protocol error";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
230 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
231
d5392bb5da3c Added generated files
lost
parents:
diff changeset
232 # if GNULIB_defined_EMULTIHOP
d5392bb5da3c Added generated files
lost
parents:
diff changeset
233 case EMULTIHOP:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
234 return "Multihop attempted";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
235 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
236
d5392bb5da3c Added generated files
lost
parents:
diff changeset
237 # if GNULIB_defined_EBADMSG
d5392bb5da3c Added generated files
lost
parents:
diff changeset
238 case EBADMSG:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
239 return "Bad message";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
240 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
241
d5392bb5da3c Added generated files
lost
parents:
diff changeset
242 # if GNULIB_defined_EOVERFLOW
d5392bb5da3c Added generated files
lost
parents:
diff changeset
243 case EOVERFLOW:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
244 return "Value too large for defined data type";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
245 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
246
d5392bb5da3c Added generated files
lost
parents:
diff changeset
247 # if GNULIB_defined_ENOTSUP
d5392bb5da3c Added generated files
lost
parents:
diff changeset
248 case ENOTSUP:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
249 return "Not supported";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
250 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
251
d5392bb5da3c Added generated files
lost
parents:
diff changeset
252 # if GNULIB_defined_
d5392bb5da3c Added generated files
lost
parents:
diff changeset
253 case ECANCELED:
d5392bb5da3c Added generated files
lost
parents:
diff changeset
254 return "Operation canceled";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
255 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
256 }
d5392bb5da3c Added generated files
lost
parents:
diff changeset
257
d5392bb5da3c Added generated files
lost
parents:
diff changeset
258 {
d5392bb5da3c Added generated files
lost
parents:
diff changeset
259 char *result = strerror (n);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
260
d5392bb5da3c Added generated files
lost
parents:
diff changeset
261 if (result == NULL || result[0] == '\0')
d5392bb5da3c Added generated files
lost
parents:
diff changeset
262 {
d5392bb5da3c Added generated files
lost
parents:
diff changeset
263 static char const fmt[] = "Unknown error (%d)";
d5392bb5da3c Added generated files
lost
parents:
diff changeset
264 static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)];
d5392bb5da3c Added generated files
lost
parents:
diff changeset
265 sprintf (mesg, fmt, n);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
266 return mesg;
d5392bb5da3c Added generated files
lost
parents:
diff changeset
267 }
d5392bb5da3c Added generated files
lost
parents:
diff changeset
268
d5392bb5da3c Added generated files
lost
parents:
diff changeset
269 return result;
d5392bb5da3c Added generated files
lost
parents:
diff changeset
270 }
d5392bb5da3c Added generated files
lost
parents:
diff changeset
271 }
d5392bb5da3c Added generated files
lost
parents:
diff changeset
272
d5392bb5da3c Added generated files
lost
parents:
diff changeset
273 #endif