Mercurial > flash_v2
comparison packages/error/current/src/strerror.cxx @ 115:6ed91473a1cd ecos-sw-2000-08-21
Merge from eCos master repository on 2000-08-21-22:40:54-BST
| author | jlarmour |
|---|---|
| date | Fri, 25 Aug 2000 17:32:38 +0000 |
| parents | 435cced73e2f |
| children | e0c0827131d1 |
comparison
equal
deleted
inserted
replaced
| 114:5ad2b71d525e | 115:6ed91473a1cd |
|---|---|
| 29 // | 29 // |
| 30 //####COPYRIGHTEND#### | 30 //####COPYRIGHTEND#### |
| 31 //=========================================================================== | 31 //=========================================================================== |
| 32 //#####DESCRIPTIONBEGIN#### | 32 //#####DESCRIPTIONBEGIN#### |
| 33 // | 33 // |
| 34 // Author(s): jlarmour | 34 // Author(s): jlarmour |
| 35 // Contributors: jlarmour | 35 // Contributors: |
| 36 // Date: 1998-06-11 | 36 // Date: 2000-04-14 |
| 37 // Purpose: To provide the strerror() implementation | 37 // Purpose: To provide the strerror() implementation |
| 38 // Description: This implements strerror() as described in ANSI chap 7.11.6.2 | 38 // Description: This implements strerror() as described in ANSI chap 7.11.6.2 |
| 39 // Usage: See <cyg/error/codes.h> | 39 // Usage: See <cyg/error/codes.h> |
| 40 // | 40 // |
| 41 //####DESCRIPTIONEND#### | 41 //####DESCRIPTIONEND#### |
| 42 // | 42 // |
| 43 //=========================================================================== | 43 //=========================================================================== |
| 44 | 44 |
| 45 | 45 |
| 46 // CONFIGURATION | 46 // CONFIGURATION |
| 47 | 47 |
| 48 #include <pkgconf/error.h> // Configuration header | 48 #include <pkgconf/error.h> // Configuration header |
| 49 | |
| 50 // Include the C library? | |
| 51 #ifdef CYGPKG_ERROR | |
| 52 | 49 |
| 53 // INCLUDES | 50 // INCLUDES |
| 54 | 51 |
| 55 #include <cyg/infra/cyg_type.h> // Common project-wide type definitions | 52 #include <cyg/infra/cyg_type.h> // Common project-wide type definitions |
| 56 #include <cyg/infra/cyg_trac.h> // Tracing support | 53 #include <cyg/infra/cyg_trac.h> // Tracing support |
| 58 // file | 55 // file |
| 59 | 56 |
| 60 // EXPORTED SYMBOLS | 57 // EXPORTED SYMBOLS |
| 61 | 58 |
| 62 externC char * | 59 externC char * |
| 63 strerror( int errnum ) __attribute__ ((weak, alias("_strerror") )); | 60 strerror( int errnum ) __attribute__ ((weak, alias("__strerror") )); |
| 64 | 61 |
| 65 // FUNCTIONS | 62 // FUNCTIONS |
| 66 | 63 |
| 67 externC char * | 64 externC char * |
| 68 _strerror( int errnum ) | 65 __strerror( int errnum ) |
| 69 { | 66 { |
| 70 register char *s; | 67 register char *s; |
| 71 | 68 |
| 72 CYG_REPORT_FUNCNAMETYPE( "_strerror", "String form of error is \"%s\"" ); | 69 CYG_REPORT_FUNCNAMETYPE( "__strerror", "String form of error is \"%s\"" ); |
| 73 | 70 |
| 74 switch (errnum) | 71 switch (errnum) |
| 75 { | 72 { |
| 76 | 73 |
| 77 #ifdef ENOERR | 74 #ifdef ENOERR |
| 138 case ENODEV: | 135 case ENODEV: |
| 139 s = "No such device"; | 136 s = "No such device"; |
| 140 break; | 137 break; |
| 141 #endif | 138 #endif |
| 142 | 139 |
| 140 #ifdef ENOTDIR | |
| 141 case ENOTDIR: | |
| 142 s = "Not a directory"; | |
| 143 break; | |
| 144 #endif | |
| 145 | |
| 146 #ifdef EISDIR | |
| 147 case EISDIR: | |
| 148 s = "Is a directory"; | |
| 149 break; | |
| 150 #endif | |
| 151 | |
| 143 #ifdef EINVAL | 152 #ifdef EINVAL |
| 144 case EINVAL: | 153 case EINVAL: |
| 145 s = "Invalid argument"; | 154 s = "Invalid argument"; |
| 146 break; | 155 break; |
| 147 #endif | 156 #endif |
| 148 | 157 |
| 158 #ifdef ENFILE | |
| 159 case ENFILE: | |
| 160 s = "Too many open files in system"; | |
| 161 break; | |
| 162 #endif | |
| 163 | |
| 149 #ifdef EMFILE | 164 #ifdef EMFILE |
| 150 case EMFILE: | 165 case EMFILE: |
| 151 s = "Too many open files"; | 166 s = "Too many open files"; |
| 152 break; | 167 break; |
| 153 #endif | 168 #endif |
| 154 | 169 |
| 170 #ifdef EFBIG | |
| 171 case EFBIG: | |
| 172 s = "File too large"; | |
| 173 break; | |
| 174 #endif | |
| 175 | |
| 176 #ifdef ENOSPC | |
| 177 case ENOSPC: | |
| 178 s = "No space left on device"; | |
| 179 break; | |
| 180 #endif | |
| 181 | |
| 182 #ifdef ESPIPE | |
| 183 case ESPIPE: | |
| 184 s = "Illegal seek"; | |
| 185 break; | |
| 186 #endif | |
| 187 | |
| 188 #ifdef EROFS | |
| 189 case EROFS: | |
| 190 s = "Read-only file system"; | |
| 191 break; | |
| 192 #endif | |
| 193 | |
| 155 #ifdef EDOM | 194 #ifdef EDOM |
| 156 case EDOM: | 195 case EDOM: |
| 157 s = "Argument to math function outside valid domain"; | 196 s = "Argument to math function outside valid domain"; |
| 158 break; | 197 break; |
| 159 #endif | 198 #endif |
| 162 case ERANGE: | 201 case ERANGE: |
| 163 s = "Math result cannot be represented"; | 202 s = "Math result cannot be represented"; |
| 164 break; | 203 break; |
| 165 #endif | 204 #endif |
| 166 | 205 |
| 206 #ifdef EDEADLK | |
| 207 case EDEADLK: | |
| 208 s = "Resource deadlock would occur"; | |
| 209 break; | |
| 210 #endif | |
| 211 | |
| 167 #ifdef ENOSYS | 212 #ifdef ENOSYS |
| 168 case ENOSYS: | 213 case ENOSYS: |
| 169 s = "Function not implemented"; | 214 s = "Function not implemented"; |
| 170 break; | 215 break; |
| 171 #endif | 216 #endif |
| 172 | 217 |
| 218 #ifdef ENAMETOOLONG | |
| 219 case ENAMETOOLONG: | |
| 220 s = "File name too long"; | |
| 221 break; | |
| 222 #endif | |
| 223 | |
| 224 #ifdef ENOTSUP | |
| 225 case ENOTSUP: | |
| 226 s = "Not supported"; | |
| 227 break; | |
| 228 #endif | |
| 229 | |
| 173 #ifdef EEOF | 230 #ifdef EEOF |
| 174 case EEOF: | 231 case EEOF: |
| 175 s = "End of file reached"; | 232 s = "End of file reached"; |
| 176 break; | 233 break; |
| 177 #endif | 234 #endif |
| 186 case EDEVNOSUPP: | 243 case EDEVNOSUPP: |
| 187 s = "Device does not support this operation"; | 244 s = "Device does not support this operation"; |
| 188 break; | 245 break; |
| 189 #endif | 246 #endif |
| 190 | 247 |
| 248 #ifdef EXDEV | |
| 249 case EXDEV: | |
| 250 s = "Improper link"; | |
| 251 break; | |
| 252 #endif | |
| 253 | |
| 191 // Additional errors used by networking | 254 // Additional errors used by networking |
| 192 #ifdef ENXIO | 255 #ifdef ENXIO |
| 193 case ENXIO: | 256 case ENXIO: |
| 194 s = "Device not configured"; | 257 s = "Device not configured"; |
| 195 break; | 258 break; |
| 362 } // switch | 425 } // switch |
| 363 | 426 |
| 364 CYG_REPORT_RETVAL(s); | 427 CYG_REPORT_RETVAL(s); |
| 365 | 428 |
| 366 return s; | 429 return s; |
| 367 } // _strerror() | 430 } // __strerror() |
| 368 | |
| 369 #endif // ifdef CYGPKG_ERROR | |
| 370 | 431 |
| 371 // EOF strerror.cxx | 432 // EOF strerror.cxx |
