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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [error/] [current/] [src/] [strerror.cxx] - Blame information for rev 794

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

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

powered by: WebSVN 2.1.0

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