OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [error/] [v2_0/] [src/] [strerror.cxx] - Blame information for rev 574

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
//===========================================================================
2
//
3
//      strerror.cxx
4
//
5
//      ANSI error code string routine
6
//
7
//===========================================================================
8
//####ECOSGPLCOPYRIGHTBEGIN####
9
// -------------------------------------------
10
// This file is part of eCos, the Embedded Configurable Operating System.
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12
//
13
// eCos is free software; you can redistribute it and/or modify it under
14
// the terms of the GNU General Public License as published by the Free
15
// Software Foundation; either version 2 or (at your option) any later version.
16
//
17
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20
// for more details.
21
//
22
// You should have received a copy of the GNU General Public License along
23
// with eCos; if not, write to the Free Software Foundation, Inc.,
24
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25
//
26
// As a special exception, if other files instantiate templates or use macros
27
// or inline functions from this file, or you compile this file and link it
28
// with other works to produce a work based on this file, this file does not
29
// by itself cause the resulting work to be covered by the GNU General Public
30
// License. However the source code for this file must still be made available
31
// in accordance with section (3) of the GNU General Public License.
32
//
33
// This exception does not invalidate any other reasons why a work based on
34
// this file might be covered by the GNU General Public License.
35
//
36
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37
// at http://sources.redhat.com/ecos/ecos-license/
38
// -------------------------------------------
39
//####ECOSGPLCOPYRIGHTEND####
40
//===========================================================================
41
//#####DESCRIPTIONBEGIN####
42
//
43
// Author(s):    jlarmour
44
// Contributors: 
45
// Date:         2000-04-14
46
// Purpose:      To provide the strerror() implementation
47
// Description:  This implements strerror() as described in ANSI chap 7.11.6.2
48
// Usage:        See <cyg/error/codes.h>
49
//
50
//####DESCRIPTIONEND####
51
//
52
//===========================================================================
53
 
54
 
55
// CONFIGURATION
56
 
57
#include <pkgconf/error.h>   // Configuration header
58
 
59
// INCLUDES
60
 
61
#include <cyg/infra/cyg_type.h>   // Common project-wide type definitions
62
#include <cyg/infra/cyg_trac.h>   // Tracing support
63
#include <cyg/error/codes.h>      // Error code definitions and header for this
64
                                  // file
65
 
66
// EXPORTED SYMBOLS
67
 
68
externC char *
69
strerror( int errnum ) __attribute__ ((weak, alias("__strerror") ));
70
 
71
// FUNCTIONS
72
 
73
externC char *
74
__strerror( int errnum )
75
{
76
    register char *s;
77
 
78
    CYG_REPORT_FUNCNAMETYPE( "__strerror", "String form of error is \"%s\"" );
79
 
80
    switch (errnum)
81
    {
82
 
83
#ifdef ENOERR
84
    case ENOERR:
85
        s = "No error";
86
        break;
87
#endif
88
 
89
#ifdef EPERM
90
    case EPERM:
91
        s = "Not permitted";
92
        break;
93
#endif
94
 
95
#ifdef ENOENT
96
    case ENOENT:
97
        s = "No such entity";
98
        break;
99
#endif
100
 
101
#ifdef ESRCH
102
    case ESRCH:
103
        s = "No such process";
104
        break;
105
#endif
106
 
107
#ifdef EINTR
108
    case EINTR:
109
        s = "Operation interrupted";
110
        break;
111
#endif
112
 
113
#ifdef EIO
114
    case EIO:
115
        s = "I/O error";
116
        break;
117
#endif
118
 
119
#ifdef EBADF
120
    case EBADF:
121
        s = "Bad file handle";
122
        break;
123
#endif
124
 
125
#ifdef EAGAIN
126
    case EAGAIN:
127
        s = "Try again later";
128
        break;
129
#endif
130
 
131
#ifdef ENOMEM
132
    case ENOMEM:
133
        s = "Out of memory";
134
        break;
135
#endif
136
 
137
#ifdef EBUSY
138
    case EBUSY:
139
        s = "Resource busy";
140
        break;
141
#endif
142
 
143
#ifdef ENODEV
144
    case ENODEV:
145
        s = "No such device";
146
        break;
147
#endif
148
 
149
#ifdef ENOTDIR
150
    case ENOTDIR:
151
        s = "Not a directory";
152
        break;
153
#endif
154
 
155
#ifdef EISDIR
156
    case EISDIR:
157
        s = "Is a directory";
158
        break;
159
#endif
160
 
161
#ifdef EINVAL
162
    case EINVAL:
163
        s = "Invalid argument";
164
        break;
165
#endif
166
 
167
#ifdef ENFILE
168
    case ENFILE:
169
        s = "Too many open files in system";
170
        break;
171
#endif
172
 
173
#ifdef EMFILE
174
    case EMFILE:
175
        s = "Too many open files";
176
        break;
177
#endif
178
 
179
#ifdef EFBIG
180
    case EFBIG:
181
        s = "File too large";
182
        break;
183
#endif
184
 
185
#ifdef ENOSPC
186
    case ENOSPC:
187
        s = "No space left on device";
188
        break;
189
#endif
190
 
191
#ifdef ESPIPE
192
    case ESPIPE:
193
        s = "Illegal seek";
194
        break;
195
#endif
196
 
197
#ifdef EROFS
198
    case EROFS:
199
        s = "Read-only file system";
200
        break;
201
#endif
202
 
203
#ifdef EDOM
204
    case EDOM:
205
        s = "Argument to math function outside valid domain";
206
        break;
207
#endif
208
 
209
#ifdef ERANGE
210
    case ERANGE:
211
        s = "Math result cannot be represented";
212
        break;
213
#endif
214
 
215
#ifdef EDEADLK
216
    case EDEADLK:
217
        s = "Resource deadlock would occur";
218
        break;
219
#endif
220
 
221
#ifdef ENOSYS
222
    case ENOSYS:
223
        s = "Function not implemented";
224
        break;
225
#endif
226
 
227
#ifdef ENAMETOOLONG
228
    case ENAMETOOLONG:
229
        s = "File name too long";
230
        break;
231
#endif
232
 
233
#ifdef ENOTSUP
234
    case ENOTSUP:
235
        s = "Not supported";
236
        break;
237
#endif
238
 
239
#ifdef EEOF
240
    case EEOF:
241
        s = "End of file reached";
242
        break;
243
#endif
244
 
245
#ifdef ENOSUPP
246
    case ENOSUPP:
247
        s = "Operation not supported";
248
        break;
249
#endif
250
 
251
#ifdef EDEVNOSUPP
252
    case EDEVNOSUPP:
253
        s = "Device does not support this operation";
254
        break;
255
#endif
256
 
257
#ifdef EXDEV
258
    case EXDEV:
259
        s = "Improper link";
260
        break;
261
#endif
262
 
263
// Additional errors used by networking
264
#ifdef ENXIO
265
    case ENXIO:
266
        s =  "Device not configured";
267
        break;
268
#endif
269
#ifdef EACCES
270
    case EACCES:
271
        s =  "Permission denied";
272
        break;
273
#endif
274
#ifdef EEXIST
275
    case EEXIST:
276
        s =  "File exists";
277
        break;
278
#endif
279
#ifdef ENOTTY
280
    case ENOTTY:
281
        s =  "Inappropriate ioctl for device";
282
        break;
283
#endif
284
#ifdef EPIPE
285
    case EPIPE:
286
        s =  "Broken pipe";
287
        break;
288
#endif
289
#ifdef EINPROGRESS
290
    case EINPROGRESS:
291
        s =  "Operation now in progress";
292
        break;
293
#endif
294
#ifdef EALREADY
295
    case EALREADY:
296
        s =  "Operation already in progress";
297
        break;
298
#endif
299
#ifdef ENOTSOCK
300
    case ENOTSOCK:
301
        s =  "Socket operation on non-socket";
302
        break;
303
#endif
304
#ifdef EDESTADDRREQ
305
    case EDESTADDRREQ:
306
        s =  "Destination address required";
307
        break;
308
#endif
309
#ifdef EMSGSIZE
310
    case EMSGSIZE:
311
        s =  "Message too long";
312
        break;
313
#endif
314
#ifdef EPROTOTYPE
315
    case EPROTOTYPE:
316
        s =  "Protocol wrong type for socket";
317
        break;
318
#endif
319
#ifdef ENOPROTOOPT
320
    case ENOPROTOOPT:
321
        s =  "Protocol not available";
322
        break;
323
#endif
324
#ifdef EPROTONOSUPPORT
325
    case EPROTONOSUPPORT:
326
        s =  "Protocol not supported";
327
        break;
328
#endif
329
#ifdef ESOCKTNOSUPPORT
330
    case ESOCKTNOSUPPORT:
331
        s =  "Socket type not supported";
332
        break;
333
#endif
334
#ifdef EOPNOTSUPP
335
    case EOPNOTSUPP:
336
        s =  "Operation not supported";
337
        break;
338
#endif
339
#ifdef EPFNOSUPPORT
340
    case EPFNOSUPPORT:
341
        s =  "Protocol family not supported";
342
        break;
343
#endif
344
#ifdef EAFNOSUPPORT
345
    case EAFNOSUPPORT:
346
        s =  "Address family not supported by protocol family";
347
        break;
348
#endif
349
#ifdef EADDRINUSE
350
    case EADDRINUSE:
351
        s =  "Address already in use";
352
        break;
353
#endif
354
#ifdef EADDRNOTAVAIL
355
    case EADDRNOTAVAIL:
356
        s =  "Can't assign requested address";
357
        break;
358
#endif
359
#ifdef ENETDOWN
360
    case ENETDOWN:
361
        s =  "Network is down";
362
        break;
363
#endif
364
#ifdef ENETUNREACH
365
    case ENETUNREACH:
366
        s =  "Network is unreachable";
367
        break;
368
#endif
369
#ifdef ENETRESET
370
    case ENETRESET:
371
        s =  "Network dropped connection on reset";
372
        break;
373
#endif
374
#ifdef ECONNABORTED
375
    case ECONNABORTED:
376
        s =  "Software caused connection abort";
377
        break;
378
#endif
379
#ifdef ECONNRESET
380
    case ECONNRESET:
381
        s =  "Connection reset by peer";
382
        break;
383
#endif
384
#ifdef ENOBUFS
385
    case ENOBUFS:
386
        s =  "No buffer space available";
387
        break;
388
#endif
389
#ifdef EISCONN
390
    case EISCONN:
391
        s =  "Socket is already connected";
392
        break;
393
#endif
394
#ifdef ENOTCONN
395
    case ENOTCONN:
396
        s =  "Socket is not connected";
397
        break;
398
#endif
399
#ifdef ESHUTDOWN
400
    case ESHUTDOWN:
401
        s =  "Can't send after socket shutdown";
402
        break;
403
#endif
404
#ifdef ETOOMANYREFS
405
    case ETOOMANYREFS:
406
        s =  "Too many references: can't splice";
407
        break;
408
#endif
409
#ifdef ETIMEDOUT
410
    case ETIMEDOUT:
411
        s =  "Operation timed out";
412
        break;
413
#endif
414
#ifdef ECONNREFUSED
415
    case ECONNREFUSED:
416
        s =  "Connection refused";
417
        break;
418
#endif
419
#ifdef EHOSTDOWN
420
    case EHOSTDOWN:
421
        s =  "Host is down";
422
        break;
423
#endif
424
#ifdef EHOSTUNREACH
425
    case EHOSTUNREACH:
426
        s =  "No route to host";
427
        break;
428
#endif
429
 
430
    default:
431
        s = "Unknown error";
432
        break;
433
 
434
    } // switch
435
 
436
    CYG_REPORT_RETVAL(s);
437
 
438
    return s;
439
} // __strerror()
440
 
441
// EOF strerror.cxx

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.