1 //===========================================================================
5 // ANSI error code string routine
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.
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.
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
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.
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.
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.
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####
43 // Author(s): jlarmour
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>
50 //####DESCRIPTIONEND####
52 //===========================================================================
57 #include <pkgconf/error.h> // Configuration header
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
69 strerror( int errnum ) __attribute__ ((weak, alias("__strerror") ));
74 __strerror( int errnum )
78 CYG_REPORT_FUNCNAMETYPE( "__strerror", "String form of error is \"%s\"" );
103 s = "No such process";
109 s = "Operation interrupted";
121 s = "Bad file handle";
127 s = "Try again later";
145 s = "No such device";
151 s = "Not a directory";
157 s = "Is a directory";
163 s = "Invalid argument";
169 s = "Too many open files in system";
175 s = "Too many open files";
181 s = "File too large";
187 s = "No space left on device";
199 s = "Read-only file system";
205 s = "Argument to math function outside valid domain";
211 s = "Math result cannot be represented";
217 s = "Resource deadlock would occur";
223 s = "Function not implemented";
229 s = "File name too long";
241 s = "End of file reached";
247 s = "Operation not supported";
253 s = "Device does not support this operation";
263 // Additional errors used by networking
266 s = "Device not configured";
271 s = "Permission denied";
281 s = "Inappropriate ioctl for device";
291 s = "Operation now in progress";
296 s = "Operation already in progress";
301 s = "Socket operation on non-socket";
306 s = "Destination address required";
311 s = "Message too long";
316 s = "Protocol wrong type for socket";
321 s = "Protocol not available";
324 #ifdef EPROTONOSUPPORT
325 case EPROTONOSUPPORT:
326 s = "Protocol not supported";
329 #ifdef ESOCKTNOSUPPORT
330 case ESOCKTNOSUPPORT:
331 s = "Socket type not supported";
336 s = "Operation not supported";
341 s = "Protocol family not supported";
346 s = "Address family not supported by protocol family";
351 s = "Address already in use";
356 s = "Can't assign requested address";
361 s = "Network is down";
366 s = "Network is unreachable";
371 s = "Network dropped connection on reset";
376 s = "Software caused connection abort";
381 s = "Connection reset by peer";
386 s = "No buffer space available";
391 s = "Socket is already connected";
396 s = "Socket is not connected";
401 s = "Can't send after socket shutdown";
406 s = "Too many references: can't splice";
411 s = "Operation timed out";
416 s = "Connection refused";
426 s = "No route to host";
436 CYG_REPORT_RETVAL(s);