annotate lib/strerror.c @ 265:68fbca173508 2.6

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