~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/strerror-override.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* strerror-override.c --- POSIX compatible system error routine
2
2
 
3
 
   Copyright (C) 2010-2011 Free Software Foundation, Inc.
 
3
   Copyright (C) 2010-2012 Free Software Foundation, Inc.
4
4
 
5
5
   This program is free software: you can redistribute it and/or modify
6
6
   it under the terms of the GNU General Public License as published by
23
23
 
24
24
#include <errno.h>
25
25
 
26
 
#if GNULIB_defined_ESOCK /* native Windows platforms */
 
26
#if GNULIB_defined_EWINSOCK /* native Windows platforms */
27
27
# if HAVE_WINSOCK2_H
28
28
#  include <winsock2.h>
29
29
# endif
42
42
      return "Success";
43
43
#endif
44
44
 
45
 
#if GNULIB_defined_ETXTBSY
46
 
    case ETXTBSY:
47
 
      return "Text file busy";
48
 
#endif
49
 
 
50
 
#if GNULIB_defined_ESOCK /* native Windows platforms */
51
 
      /* EWOULDBLOCK is the same as EAGAIN.  */
 
45
#if GNULIB_defined_ESOCK /* native Windows platforms with older <errno.h> */
52
46
    case EINPROGRESS:
53
47
      return "Operation now in progress";
54
48
    case EALREADY:
65
59
      return "Protocol not available";
66
60
    case EPROTONOSUPPORT:
67
61
      return "Protocol not supported";
68
 
    case ESOCKTNOSUPPORT:
69
 
      return "Socket type not supported";
70
62
    case EOPNOTSUPP:
71
63
      return "Operation not supported";
72
 
    case EPFNOSUPPORT:
73
 
      return "Protocol family not supported";
74
64
    case EAFNOSUPPORT:
75
65
      return "Address family not supported by protocol";
76
66
    case EADDRINUSE:
81
71
      return "Network is down";
82
72
    case ENETUNREACH:
83
73
      return "Network is unreachable";
84
 
    case ENETRESET:
85
 
      return "Network dropped connection on reset";
86
 
    case ECONNABORTED:
87
 
      return "Software caused connection abort";
88
74
    case ECONNRESET:
89
75
      return "Connection reset by peer";
90
76
    case ENOBUFS:
93
79
      return "Transport endpoint is already connected";
94
80
    case ENOTCONN:
95
81
      return "Transport endpoint is not connected";
96
 
    case ESHUTDOWN:
97
 
      return "Cannot send after transport endpoint shutdown";
98
 
    case ETOOMANYREFS:
99
 
      return "Too many references: cannot splice";
100
82
    case ETIMEDOUT:
101
83
      return "Connection timed out";
102
84
    case ECONNREFUSED:
103
85
      return "Connection refused";
104
86
    case ELOOP:
105
87
      return "Too many levels of symbolic links";
 
88
    case EHOSTUNREACH:
 
89
      return "No route to host";
 
90
    case EWOULDBLOCK:
 
91
      return "Operation would block";
 
92
#endif
 
93
#if GNULIB_defined_ESTREAMS /* native Windows platforms with older <errno.h> */
 
94
    case ETXTBSY:
 
95
      return "Text file busy";
 
96
    case ENODATA:
 
97
      return "No data available";
 
98
    case ENOSR:
 
99
      return "Out of streams resources";
 
100
    case ENOSTR:
 
101
      return "Device not a stream";
 
102
    case ETIME:
 
103
      return "Timer expired";
 
104
    case EOTHER:
 
105
      return "Other error";
 
106
#endif
 
107
#if GNULIB_defined_EWINSOCK /* native Windows platforms */
 
108
    case ESOCKTNOSUPPORT:
 
109
      return "Socket type not supported";
 
110
    case EPFNOSUPPORT:
 
111
      return "Protocol family not supported";
 
112
    case ESHUTDOWN:
 
113
      return "Cannot send after transport endpoint shutdown";
 
114
    case ETOOMANYREFS:
 
115
      return "Too many references: cannot splice";
106
116
    case EHOSTDOWN:
107
117
      return "Host is down";
108
 
    case EHOSTUNREACH:
109
 
      return "No route to host";
110
118
    case EPROCLIM:
111
119
      return "Too many processes";
112
120
    case EUSERS:
134
142
      /* WSAEINVAL maps to EINVAL */
135
143
      /* WSAEMFILE maps to EMFILE */
136
144
      /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
137
 
      /* WSAEINPROGRESS is EINPROGRESS */
138
 
      /* WSAEALREADY is EALREADY */
139
 
      /* WSAENOTSOCK is ENOTSOCK */
140
 
      /* WSAEDESTADDRREQ is EDESTADDRREQ */
141
 
      /* WSAEMSGSIZE is EMSGSIZE */
142
 
      /* WSAEPROTOTYPE is EPROTOTYPE */
143
 
      /* WSAENOPROTOOPT is ENOPROTOOPT */
144
 
      /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */
 
145
      /* WSAEINPROGRESS maps to EINPROGRESS */
 
146
      /* WSAEALREADY maps to EALREADY */
 
147
      /* WSAENOTSOCK maps to ENOTSOCK */
 
148
      /* WSAEDESTADDRREQ maps to EDESTADDRREQ */
 
149
      /* WSAEMSGSIZE maps to EMSGSIZE */
 
150
      /* WSAEPROTOTYPE maps to EPROTOTYPE */
 
151
      /* WSAENOPROTOOPT maps to ENOPROTOOPT */
 
152
      /* WSAEPROTONOSUPPORT maps to EPROTONOSUPPORT */
145
153
      /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
146
 
      /* WSAEOPNOTSUPP is EOPNOTSUPP */
 
154
      /* WSAEOPNOTSUPP maps to EOPNOTSUPP */
147
155
      /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
148
 
      /* WSAEAFNOSUPPORT is EAFNOSUPPORT */
149
 
      /* WSAEADDRINUSE is EADDRINUSE */
150
 
      /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */
151
 
      /* WSAENETDOWN is ENETDOWN */
152
 
      /* WSAENETUNREACH is ENETUNREACH */
153
 
      /* WSAENETRESET is ENETRESET */
154
 
      /* WSAECONNABORTED is ECONNABORTED */
155
 
      /* WSAECONNRESET is ECONNRESET */
156
 
      /* WSAENOBUFS is ENOBUFS */
157
 
      /* WSAEISCONN is EISCONN */
158
 
      /* WSAENOTCONN is ENOTCONN */
 
156
      /* WSAEAFNOSUPPORT maps to EAFNOSUPPORT */
 
157
      /* WSAEADDRINUSE maps to EADDRINUSE */
 
158
      /* WSAEADDRNOTAVAIL maps to EADDRNOTAVAIL */
 
159
      /* WSAENETDOWN maps to ENETDOWN */
 
160
      /* WSAENETUNREACH maps to ENETUNREACH */
 
161
      /* WSAENETRESET maps to ENETRESET */
 
162
      /* WSAECONNABORTED maps to ECONNABORTED */
 
163
      /* WSAECONNRESET maps to ECONNRESET */
 
164
      /* WSAENOBUFS maps to ENOBUFS */
 
165
      /* WSAEISCONN maps to EISCONN */
 
166
      /* WSAENOTCONN maps to ENOTCONN */
159
167
      /* WSAESHUTDOWN is ESHUTDOWN */
160
168
      /* WSAETOOMANYREFS is ETOOMANYREFS */
161
 
      /* WSAETIMEDOUT is ETIMEDOUT */
162
 
      /* WSAECONNREFUSED is ECONNREFUSED */
163
 
      /* WSAELOOP is ELOOP */
 
169
      /* WSAETIMEDOUT maps to ETIMEDOUT */
 
170
      /* WSAECONNREFUSED maps to ECONNREFUSED */
 
171
      /* WSAELOOP maps to ELOOP */
164
172
      /* WSAENAMETOOLONG maps to ENAMETOOLONG */
165
173
      /* WSAEHOSTDOWN is EHOSTDOWN */
166
 
      /* WSAEHOSTUNREACH is EHOSTUNREACH */
 
174
      /* WSAEHOSTUNREACH maps to EHOSTUNREACH */
167
175
      /* WSAENOTEMPTY maps to ENOTEMPTY */
168
176
      /* WSAEPROCLIM is EPROCLIM */
169
177
      /* WSAEUSERS is EUSERS */
273
281
      return "Operation canceled";
274
282
#endif
275
283
 
 
284
#if GNULIB_defined_EOWNERDEAD
 
285
    case EOWNERDEAD:
 
286
      return "Owner died";
 
287
#endif
 
288
 
 
289
#if GNULIB_defined_ENOTRECOVERABLE
 
290
    case ENOTRECOVERABLE:
 
291
      return "State not recoverable";
 
292
#endif
 
293
 
276
294
    default:
277
295
      return NULL;
278
296
    }