annotate lib/strerror.c @ 423:079d43b6967b 3.0-beta2 3.0-beta2

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