Mercurial > ecos
comparison packages/error/current/include/codes.h @ 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 | 2085233a121a |
| children | e0c0827131d1 |
comparison
equal
deleted
inserted
replaced
| 114:5ad2b71d525e | 115:6ed91473a1cd |
|---|---|
| 1 #ifndef CYGONCE_ERROR_CODES_H | 1 #ifndef CYGONCE_ERROR_CODES_H |
| 2 #define CYGONCE_ERROR_CODES_H | 2 #define CYGONCE_ERROR_CODES_H |
| 3 //=========================================================================== | 3 /*=========================================================================== |
| 4 // | 4 // |
| 5 // codes.h | 5 // codes.h |
| 6 // | 6 // |
| 7 // Common error code definitions | 7 // Common error code definitions |
| 8 // | 8 // |
| 31 // | 31 // |
| 32 //####COPYRIGHTEND#### | 32 //####COPYRIGHTEND#### |
| 33 //=========================================================================== | 33 //=========================================================================== |
| 34 //#####DESCRIPTIONBEGIN#### | 34 //#####DESCRIPTIONBEGIN#### |
| 35 // | 35 // |
| 36 // Author(s): jlarmour | 36 // Author(s): jlarmour |
| 37 // Contributors: jlarmour | 37 // Contributors: jlarmour |
| 38 // Date: 1998-06-11 | 38 // Date: 2000-04-14 |
| 39 // Purpose: To provide a common set of error codes | 39 // Purpose: To provide a common set of error codes |
| 40 // Description: This provides a common set of error codes that all packages can | 40 // Description: This provides a common set of error codes that all |
| 41 // agree on. It doesn't preclude them defining their own error | 41 // packages can agree on. It doesn't preclude them defining |
| 42 // return system, but this is a preferable system to use to help | 42 // their own error return system, but this is a preferable |
| 43 // error support be as general as possible. | 43 // system to use to help error support be as general as |
| 44 // possible. | |
| 44 // | 45 // |
| 45 // We try and conform to the ANSI/POSIX error code format, namely | 46 // We try and conform to the ANSI/POSIX error code format, |
| 46 // starting with the character 'E' | 47 // namely starting with the character 'E' |
| 47 // | 48 // |
| 48 // Usage: #include <cyg/error/codes.h> | 49 // Usage: #include <cyg/error/codes.h> |
| 49 // | 50 // |
| 50 // Example: | 51 // Example: |
| 51 // | 52 // |
| 52 // err=myfun(); | 53 // err=myfun(); |
| 53 // if (err != ENOERR) | 54 // if (err != ENOERR) |
| 54 // { | 55 // { |
| 55 // str=strerror(err); | 56 // str=strerror(err); |
| 56 // printf("myfun returned error: %s\n", str); | 57 // printf("myfun returned error: %s\n", str); |
| 57 // } | 58 // } |
| 58 // else .... | 59 // else .... |
| 59 // | 60 // |
| 60 //####DESCRIPTIONEND#### | 61 //####DESCRIPTIONEND#### |
| 61 // | 62 // |
| 62 //=========================================================================== | 63 //=========================================================================*/ |
| 63 | 64 |
| 64 // CONFIGURATION | 65 /* CONFIGURATION */ |
| 65 | 66 |
| 66 #include <pkgconf/error.h> // Configuration header | 67 #include <pkgconf/error.h> // Configuration header |
| 67 #include <cyg/infra/cyg_type.h> // externC | |
| 68 | 68 |
| 69 // Include the error package? | 69 #ifdef __cplusplus |
| 70 #ifdef CYGPKG_ERROR | 70 extern "C" { |
| 71 #endif | |
| 71 | 72 |
| 73 /* TYPE DEFINITIONS */ | |
| 72 | 74 |
| 73 // TYPE DEFINITIONS | 75 /* A type for error codes which may be useful to explain the purpose of |
| 74 | 76 * a variable or return code. It shows that it contains an error code |
| 75 // A type for error codes which may be useful to explain the purpose of | 77 * of the type defined below */ |
| 76 // a variable or return code. It shows that it contains an error code | |
| 77 // of the type defined below | |
| 78 | 78 |
| 79 typedef int Cyg_ErrNo; | 79 typedef int Cyg_ErrNo; |
| 80 | 80 |
| 81 | 81 |
| 82 // FUNCTION PROTOTYPES | 82 /* CONSTANT DEFINITIONS */ |
| 83 | 83 |
| 84 // ANSI standard strerror() function as described by ANSI chap. 7.11.6.2. | 84 /* If adding to this list, you must also update strerror() with its text |
| 85 // This is normally provided by <string.h> | 85 * If there is a common error of the same purpose on Unix, try and use its |
| 86 * name and number. If not, use one above 200 to prevent future conflicts | |
| 87 * | |
| 88 * Do not use negative numbers, so that functions can return positive on | |
| 89 * success and -ESOMETHING on error, and it all works consistently. | |
| 90 */ | |
| 86 | 91 |
| 87 externC char * | 92 #define ENOERR 0 /* No error */ |
| 88 strerror( Cyg_ErrNo ); | 93 #define EPERM 1 /* Not permitted */ |
| 94 #define ENOENT 2 /* No such entity */ | |
| 95 #define ESRCH 3 /* No such process */ | |
| 96 #define EINTR 4 /* Operation interrupted */ | |
| 97 #define EIO 5 /* I/O error */ | |
| 98 #define EBADF 9 /* Bad file handle */ | |
| 99 #define EAGAIN 11 /* Try again later */ | |
| 100 #define EWOULDBLOCK EAGAIN | |
| 101 #define ENOMEM 12 /* Out of memory */ | |
| 102 #define EBUSY 16 /* Resource busy */ | |
| 103 #define EXDEV 18 /* Cross-device link */ | |
| 104 #define ENODEV 19 /* No such device */ | |
| 105 #define ENOTDIR 20 /* Not a directory */ | |
| 106 #define EISDIR 21 /* Is a directory */ | |
| 107 #define EINVAL 22 /* Invalid argument */ | |
| 108 #define ENFILE 23 /* Too many open files in system */ | |
| 109 #define EMFILE 24 /* Too many open files */ | |
| 110 #define EFBIG 27 /* File too large */ | |
| 111 #define ENOSPC 28 /* No space left on device */ | |
| 112 #define ESPIPE 29 /* Illegal seek */ | |
| 113 #define EROFS 30 /* Read-only file system */ | |
| 114 #define EDOM 33 /* Argument to math function outside valid */ | |
| 115 /* domain */ | |
| 116 #define ERANGE 34 /* Math result cannot be represented */ | |
| 117 #define EDEADLK 35 /* Resource deadlock would occur */ | |
| 118 #define EDEADLOCK EDEADLK | |
| 119 #define ENOSYS 38 /* Function not implemented */ | |
| 120 #define ENAMETOOLONG 60 /* File name too long */ | |
| 121 #define ENOTSUP 95 /* Not supported error */ | |
| 122 #define EEOF 200 /* End of file reached */ | |
| 123 #define ENOSUPP 201 /* Operation not supported */ | |
| 124 #define EDEVNOSUPP 202 /* Device does not support this operation */ | |
| 125 | |
| 126 /* Additional errors used by networking */ | |
| 127 #define ENXIO 300 /* Device not configured */ | |
| 128 #define EACCES 301 /* Permission denied */ | |
| 129 #define EEXIST 302 /* File exists */ | |
| 130 #define ENOTTY 303 /* Inappropriate ioctl for device */ | |
| 131 #define EPIPE 304 /* Broken pipe */ | |
| 89 | 132 |
| 90 // prototype for the actual implementation. Equivalent to the above, but | 133 /* non-blocking and interrupt i/o */ |
| 91 // used internally by this product in preference | 134 #define EINPROGRESS 310 /* Operation now in progress */ |
| 135 #define EALREADY 311 /* Operation already in progress */ | |
| 92 | 136 |
| 93 externC char * | 137 /* ipc/network software -- argument errors */ |
| 94 _strerror( Cyg_ErrNo ); | 138 #define ENOTSOCK 320 /* Socket operation on non-socket */ |
| 139 #define EDESTADDRREQ 321 /* Destination address required */ | |
| 140 #define EMSGSIZE 322 /* Message too long */ | |
| 141 #define EPROTOTYPE 323 /* Protocol wrong type for socket */ | |
| 142 #define ENOPROTOOPT 324 /* Protocol not available */ | |
| 143 #define EPROTONOSUPPORT 325 /* Protocol not supported */ | |
| 144 #define ESOCKTNOSUPPORT 326 /* Socket type not supported */ | |
| 145 #define EOPNOTSUPP 327 /* Operation not supported */ | |
| 146 #define EPFNOSUPPORT 328 /* Protocol family not supported */ | |
| 147 #define EAFNOSUPPORT 329 /* Address family not supported by */ | |
| 148 /* protocol family */ | |
| 149 #define EADDRINUSE 330 /* Address already in use */ | |
| 150 #define EADDRNOTAVAIL 331 /* Can't assign requested address */ | |
| 95 | 151 |
| 152 /* ipc/network software -- operational errors */ | |
| 153 #define ENETDOWN 350 /* Network is down */ | |
| 154 #define ENETUNREACH 351 /* Network is unreachable */ | |
| 155 #define ENETRESET 352 /* Network dropped connection on reset */ | |
| 156 #define ECONNABORTED 353 /* Software caused connection abort */ | |
| 157 #define ECONNRESET 354 /* Connection reset by peer */ | |
| 158 #define ENOBUFS 355 /* No buffer space available */ | |
| 159 #define EISCONN 356 /* Socket is already connected */ | |
| 160 #define ENOTCONN 357 /* Socket is not connected */ | |
| 161 #define ESHUTDOWN 358 /* Can't send after socket shutdown */ | |
| 162 #define ETOOMANYREFS 359 /* Too many references: can't splice */ | |
| 163 #define ETIMEDOUT 360 /* Operation timed out */ | |
| 164 #define ECONNREFUSED 361 /* Connection refused */ | |
| 96 | 165 |
| 97 // CONSTANT DEFINITIONS | 166 #define EHOSTDOWN 364 /* Host is down */ |
| 167 #define EHOSTUNREACH 365 /* No route to host */ | |
| 98 | 168 |
| 99 // If adding to this list, you must also update strerror() with its text | 169 #ifdef __cplusplus |
| 100 // If there is a common error of the same purpose on Unix, try and use its | 170 } /* extern "C" */ |
| 101 // name and number. If not, use one above 200 to prevent future conflicts | 171 #endif |
| 102 // | |
| 103 // Do not use negative numbers, so that functions can return positive on | |
| 104 // success and -ESOMETHING on error, and it all works consistently. | |
| 105 | 172 |
| 106 #define ENOERR 0 // No error | 173 #endif /* CYGONCE_ERROR_CODES_H multiple inclusion protection */ |
| 107 #define EPERM 1 // Not permitted | |
| 108 #define ENOENT 2 // No such entity | |
| 109 #define ESRCH 3 // No such process | |
| 110 #define EINTR 4 // Operation interrupted | |
| 111 #define EIO 5 // I/O error | |
| 112 #define EBADF 9 // Bad file handle | |
| 113 #define EAGAIN 11 // Try again later | |
| 114 #define EWOULDBLOCK EAGAIN | |
| 115 #define ENOMEM 12 // Out of memory | |
| 116 #define EBUSY 16 // Resource busy | |
| 117 #define ENODEV 19 // No such device | |
| 118 #define EINVAL 22 // Invalid argument | |
| 119 #define EMFILE 24 // Too many open files | |
| 120 #define EDOM 33 // Argument to math function outside valid | |
| 121 // domain | |
| 122 #define ERANGE 34 // Math result cannot be represented | |
| 123 #define ENOSYS 38 // Function not implemented | |
| 124 | 174 |
| 125 #define ENOTSUP 95 // POSIX not supported error | 175 /* EOF codes.h */ |
| 126 | |
| 127 #define EEOF 200 // End of file reached | |
| 128 #define ENOSUPP 201 // Operation not supported | |
| 129 #define EDEVNOSUPP 202 // Device does not support this operation | |
| 130 | |
| 131 #define EDEADLK 301 // POSIX deadlock error | |
| 132 | |
| 133 #ifdef CYGPKG_NET | |
| 134 // Additional errors used by networking | |
| 135 #define ENXIO 300 // Device not configured | |
| 136 #define EACCES 301 // Permission denied | |
| 137 #define EEXIST 302 // File exists | |
| 138 #define ENOTTY 303 // Inappropriate ioctl for device | |
| 139 #define EPIPE 304 // Broken pipe | |
| 140 | |
| 141 // non-blocking and interrupt i/o | |
| 142 #define EINPROGRESS 310 // Operation now in progress | |
| 143 #define EALREADY 311 // Operation already in progress | |
| 144 | |
| 145 // ipc/network software -- argument errors | |
| 146 #define ENOTSOCK 320 // Socket operation on non-socket | |
| 147 #define EDESTADDRREQ 321 // Destination address required | |
| 148 #define EMSGSIZE 322 // Message too long | |
| 149 #define EPROTOTYPE 323 // Protocol wrong type for socket | |
| 150 #define ENOPROTOOPT 324 // Protocol not available | |
| 151 #define EPROTONOSUPPORT 325 // Protocol not supported | |
| 152 #define ESOCKTNOSUPPORT 326 // Socket type not supported | |
| 153 #define EOPNOTSUPP 327 // Operation not supported | |
| 154 #define EPFNOSUPPORT 328 // Protocol family not supported | |
| 155 #define EAFNOSUPPORT 329 // Address family not supported by protocol family | |
| 156 #define EADDRINUSE 330 // Address already in use | |
| 157 #define EADDRNOTAVAIL 331 // Can't assign requested address | |
| 158 | |
| 159 // ipc/network software -- operational errors | |
| 160 #define ENETDOWN 350 // Network is down | |
| 161 #define ENETUNREACH 351 // Network is unreachable | |
| 162 #define ENETRESET 352 // Network dropped connection on reset | |
| 163 #define ECONNABORTED 353 // Software caused connection abort | |
| 164 #define ECONNRESET 354 // Connection reset by peer | |
| 165 #define ENOBUFS 355 // No buffer space available | |
| 166 #define EISCONN 356 // Socket is already connected | |
| 167 #define ENOTCONN 357 // Socket is not connected | |
| 168 #define ESHUTDOWN 358 // Can't send after socket shutdown | |
| 169 #define ETOOMANYREFS 359 // Too many references: can't splice | |
| 170 #define ETIMEDOUT 360 // Operation timed out | |
| 171 #define ECONNREFUSED 361 // Connection refused | |
| 172 | |
| 173 #define EHOSTDOWN 364 // Host is down | |
| 174 #define EHOSTUNREACH 365 // No route to host | |
| 175 #endif // CYGPKG_NET | |
| 176 | |
| 177 #endif // ifdef CYGPKG_ERROR | |
| 178 | |
| 179 #endif // CYGONCE_ERROR_CODES_H multiple inclusion protection | |
| 180 | |
| 181 // EOF codes.h |
