1 |
27 |
unneback |
#ifndef CYGONCE_ERROR_CODES_H
|
2 |
|
|
#define CYGONCE_ERROR_CODES_H
|
3 |
|
|
/*===========================================================================
|
4 |
|
|
//
|
5 |
|
|
// codes.h
|
6 |
|
|
//
|
7 |
|
|
// Common error code definitions
|
8 |
|
|
//
|
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.
|
14 |
|
|
//
|
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.
|
18 |
|
|
//
|
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
|
22 |
|
|
// for more details.
|
23 |
|
|
//
|
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.
|
27 |
|
|
//
|
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.
|
34 |
|
|
//
|
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.
|
37 |
|
|
//
|
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####
|
44 |
|
|
//
|
45 |
|
|
// Author(s): jlarmour
|
46 |
|
|
// Contributors: jlarmour
|
47 |
|
|
// Date: 2000-04-14
|
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
|
53 |
|
|
// possible.
|
54 |
|
|
//
|
55 |
|
|
// We try and conform to the ANSI/POSIX error code format,
|
56 |
|
|
// namely starting with the character 'E'
|
57 |
|
|
//
|
58 |
|
|
// Usage: #include <cyg/error/codes.h>
|
59 |
|
|
//
|
60 |
|
|
// Example:
|
61 |
|
|
//
|
62 |
|
|
// err=myfun();
|
63 |
|
|
// if (err != ENOERR)
|
64 |
|
|
// {
|
65 |
|
|
// str=strerror(err);
|
66 |
|
|
// printf("myfun returned error: %s\n", str);
|
67 |
|
|
// }
|
68 |
|
|
// else ....
|
69 |
|
|
//
|
70 |
|
|
//####DESCRIPTIONEND####
|
71 |
|
|
//
|
72 |
|
|
//=========================================================================*/
|
73 |
|
|
|
74 |
|
|
/* CONFIGURATION */
|
75 |
|
|
|
76 |
|
|
#include <pkgconf/error.h> // Configuration header
|
77 |
|
|
|
78 |
|
|
#ifdef __cplusplus
|
79 |
|
|
extern "C" {
|
80 |
|
|
#endif
|
81 |
|
|
|
82 |
|
|
/* TYPE DEFINITIONS */
|
83 |
|
|
|
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 */
|
87 |
|
|
|
88 |
|
|
typedef int Cyg_ErrNo;
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
/* CONSTANT DEFINITIONS */
|
92 |
|
|
|
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
|
96 |
|
|
*
|
97 |
|
|
* Do not use negative numbers, so that functions can return positive on
|
98 |
|
|
* success and -ESOMETHING on error, and it all works consistently.
|
99 |
|
|
*/
|
100 |
|
|
|
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 */
|
124 |
|
|
/* domain */
|
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 ENOTSUP 95 /* Not supported error */
|
131 |
|
|
#define EEOF 200 /* End of file reached */
|
132 |
|
|
#define ENOSUPP 201 /* Operation not supported */
|
133 |
|
|
#define EDEVNOSUPP 202 /* Device does not support this operation */
|
134 |
|
|
|
135 |
|
|
/* Additional errors used by networking */
|
136 |
|
|
#define ENXIO 300 /* Device not configured */
|
137 |
|
|
#define EACCES 301 /* Permission denied */
|
138 |
|
|
#define EEXIST 302 /* File exists */
|
139 |
|
|
#define ENOTTY 303 /* Inappropriate ioctl for device */
|
140 |
|
|
#define EPIPE 304 /* Broken pipe */
|
141 |
|
|
|
142 |
|
|
/* non-blocking and interrupt i/o */
|
143 |
|
|
#define EINPROGRESS 310 /* Operation now in progress */
|
144 |
|
|
#define EALREADY 311 /* Operation already in progress */
|
145 |
|
|
|
146 |
|
|
/* ipc/network software -- argument errors */
|
147 |
|
|
#define ENOTSOCK 320 /* Socket operation on non-socket */
|
148 |
|
|
#define EDESTADDRREQ 321 /* Destination address required */
|
149 |
|
|
#define EMSGSIZE 322 /* Message too long */
|
150 |
|
|
#define EPROTOTYPE 323 /* Protocol wrong type for socket */
|
151 |
|
|
#define ENOPROTOOPT 324 /* Protocol not available */
|
152 |
|
|
#define EPROTONOSUPPORT 325 /* Protocol not supported */
|
153 |
|
|
#define ESOCKTNOSUPPORT 326 /* Socket type not supported */
|
154 |
|
|
#define EOPNOTSUPP 327 /* Operation not supported */
|
155 |
|
|
#define EPFNOSUPPORT 328 /* Protocol family not supported */
|
156 |
|
|
#define EAFNOSUPPORT 329 /* Address family not supported by */
|
157 |
|
|
/* protocol family */
|
158 |
|
|
#define EADDRINUSE 330 /* Address already in use */
|
159 |
|
|
#define EADDRNOTAVAIL 331 /* Can't assign requested address */
|
160 |
|
|
|
161 |
|
|
/* ipc/network software -- operational errors */
|
162 |
|
|
#define ENETDOWN 350 /* Network is down */
|
163 |
|
|
#define ENETUNREACH 351 /* Network is unreachable */
|
164 |
|
|
#define ENETRESET 352 /* Network dropped connection on reset */
|
165 |
|
|
#define ECONNABORTED 353 /* Software caused connection abort */
|
166 |
|
|
#define ECONNRESET 354 /* Connection reset by peer */
|
167 |
|
|
#define ENOBUFS 355 /* No buffer space available */
|
168 |
|
|
#define EISCONN 356 /* Socket is already connected */
|
169 |
|
|
#define ENOTCONN 357 /* Socket is not connected */
|
170 |
|
|
#define ESHUTDOWN 358 /* Can't send after socket shutdown */
|
171 |
|
|
#define ETOOMANYREFS 359 /* Too many references: can't splice */
|
172 |
|
|
#define ETIMEDOUT 360 /* Operation timed out */
|
173 |
|
|
#define ECONNREFUSED 361 /* Connection refused */
|
174 |
|
|
|
175 |
|
|
#define EHOSTDOWN 364 /* Host is down */
|
176 |
|
|
#define EHOSTUNREACH 365 /* No route to host */
|
177 |
|
|
|
178 |
|
|
#ifdef __cplusplus
|
179 |
|
|
} /* extern "C" */
|
180 |
|
|
#endif
|
181 |
|
|
|
182 |
|
|
#endif /* CYGONCE_ERROR_CODES_H multiple inclusion protection */
|
183 |
|
|
|
184 |
|
|
/* EOF codes.h */
|