1 #ifndef CYGONCE_ERROR_CODES_H
2 #define CYGONCE_ERROR_CODES_H
3 /*===========================================================================
7 // Common error code definitions
9 //===========================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
38 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 // at http://sources.redhat.com/ecos/ecos-license/
40 // -------------------------------------------
41 //####ECOSGPLCOPYRIGHTEND####
42 //===========================================================================
43 //#####DESCRIPTIONBEGIN####
45 // Author(s): jlarmour
46 // Contributors: jlarmour
48 // Purpose: To provide a common set of error codes
49 // Description: This provides a common set of error codes that all
50 // packages can agree on. It doesn't preclude them defining
51 // their own error return system, but this is a preferable
52 // system to use to help error support be as general as
55 // We try and conform to the ANSI/POSIX error code format,
56 // namely starting with the character 'E'
58 // Usage: #include <cyg/error/codes.h>
66 // printf("myfun returned error: %s\n", str);
70 //####DESCRIPTIONEND####
72 //=========================================================================*/
76 #include <pkgconf/error.h> // Configuration header
82 /* TYPE DEFINITIONS */
84 /* A type for error codes which may be useful to explain the purpose of
85 * a variable or return code. It shows that it contains an error code
86 * of the type defined below */
88 typedef int Cyg_ErrNo;
91 /* CONSTANT DEFINITIONS */
93 /* If adding to this list, you must also update strerror() with its text
94 * If there is a common error of the same purpose on Unix, try and use its
95 * name and number. If not, use one above 200 to prevent future conflicts
97 * Do not use negative numbers, so that functions can return positive on
98 * success and -ESOMETHING on error, and it all works consistently.
101 #define ENOERR 0 /* No error */
102 #define EPERM 1 /* Not permitted */
103 #define ENOENT 2 /* No such entity */
104 #define ESRCH 3 /* No such process */
105 #define EINTR 4 /* Operation interrupted */
106 #define EIO 5 /* I/O error */
107 #define EBADF 9 /* Bad file handle */
108 #define EAGAIN 11 /* Try again later */
109 #define EWOULDBLOCK EAGAIN
110 #define ENOMEM 12 /* Out of memory */
111 #define EBUSY 16 /* Resource busy */
112 #define EXDEV 18 /* Cross-device link */
113 #define ENODEV 19 /* No such device */
114 #define ENOTDIR 20 /* Not a directory */
115 #define EISDIR 21 /* Is a directory */
116 #define EINVAL 22 /* Invalid argument */
117 #define ENFILE 23 /* Too many open files in system */
118 #define EMFILE 24 /* Too many open files */
119 #define EFBIG 27 /* File too large */
120 #define ENOSPC 28 /* No space left on device */
121 #define ESPIPE 29 /* Illegal seek */
122 #define EROFS 30 /* Read-only file system */
123 #define EDOM 33 /* Argument to math function outside valid */
125 #define ERANGE 34 /* Math result cannot be represented */
126 #define EDEADLK 35 /* Resource deadlock would occur */
127 #define EDEADLOCK EDEADLK
128 #define ENOSYS 38 /* Function not implemented */
129 #define ENAMETOOLONG 60 /* File name too long */
130 #define ENOTEMPTY 66 /* Directory not empty */
131 #define ENOTSUP 95 /* Not supported error */
132 #define EEOF 200 /* End of file reached */
133 #define ENOSUPP 201 /* Operation not supported */
134 #define EDEVNOSUPP 202 /* Device does not support this operation */
136 /* Additional errors used by networking */
137 #define ENXIO 300 /* Device not configured */
138 #define EACCES 301 /* Permission denied */
139 #define EEXIST 302 /* File exists */
140 #define ENOTTY 303 /* Inappropriate ioctl for device */
141 #define EPIPE 304 /* Broken pipe */
143 /* non-blocking and interrupt i/o */
144 #define EINPROGRESS 310 /* Operation now in progress */
145 #define EALREADY 311 /* Operation already in progress */
147 /* ipc/network software -- argument errors */
148 #define ENOTSOCK 320 /* Socket operation on non-socket */
149 #define EDESTADDRREQ 321 /* Destination address required */
150 #define EMSGSIZE 322 /* Message too long */
151 #define EPROTOTYPE 323 /* Protocol wrong type for socket */
152 #define ENOPROTOOPT 324 /* Protocol not available */
153 #define EPROTONOSUPPORT 325 /* Protocol not supported */
154 #define ESOCKTNOSUPPORT 326 /* Socket type not supported */
155 #define EOPNOTSUPP 327 /* Operation not supported */
156 #define EPFNOSUPPORT 328 /* Protocol family not supported */
157 #define EAFNOSUPPORT 329 /* Address family not supported by */
158 /* protocol family */
159 #define EADDRINUSE 330 /* Address already in use */
160 #define EADDRNOTAVAIL 331 /* Can't assign requested address */
162 /* ipc/network software -- operational errors */
163 #define ENETDOWN 350 /* Network is down */
164 #define ENETUNREACH 351 /* Network is unreachable */
165 #define ENETRESET 352 /* Network dropped connection on reset */
166 #define ECONNABORTED 353 /* Software caused connection abort */
167 #define ECONNRESET 354 /* Connection reset by peer */
168 #define ENOBUFS 355 /* No buffer space available */
169 #define EISCONN 356 /* Socket is already connected */
170 #define ENOTCONN 357 /* Socket is not connected */
171 #define ESHUTDOWN 358 /* Can't send after socket shutdown */
172 #define ETOOMANYREFS 359 /* Too many references: can't splice */
173 #define ETIMEDOUT 360 /* Operation timed out */
174 #define ECONNREFUSED 361 /* Connection refused */
176 #define EHOSTDOWN 364 /* Host is down */
177 #define EHOSTUNREACH 365 /* No route to host */
183 #endif /* CYGONCE_ERROR_CODES_H multiple inclusion protection */