better compilation on host
[aversive.git] / include / aversive / errno.h
1 /*  
2  *  Copyright Droids Corporation, Microb Technology, Eirbot (2005)
3  * 
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  *  Revision : $Id: errno.h,v 1.1.2.2 2009-01-23 23:05:39 zer0 Exp $
19  *
20  */
21
22 /* This file contains general errors that can be returned from functions 
23  * We have to be carreful and try to return these error as often as possible
24  * isntead of a function-specific value 
25  */
26
27 #ifndef _AVERSIVE_ERRNO_H_
28 #define _AVERSIVE_ERRNO_H_
29
30 #ifndef HOST_VERSION
31
32 /* from avr-libc, does not define a lots of errors */
33 #include <errno.h>
34
35 /** No error */
36 #define ESUCCESS 0
37 /** Operation not permitted */
38 #define EPERM    1
39 /** No such file or directory */
40 #define ENOENT   2
41 /** I/O error */
42 #define EIO      5
43 /** No such device or address */
44 #define ENXIO    6
45 /** Argument list too long */
46 #define E2BIG    7
47 /** Try again */
48 #define EAGAIN   11
49 /** Out of memory */
50 #define ENOMEM   12
51 /** Bad address */
52 #define EFAULT   14
53 /** Device or resource busy */
54 #define EBUSY    16
55 /** Invalid argument */
56 #define EINVAL   22
57 /** Domain error */
58 /* #define EDOM       33 */ /* in libc */
59 /** Range error */
60 /* #define ERANGE     34 */ /* in libc */
61 /** Not supported */
62 #define ENOTSUP  126 /* the correct number is 128 */
63 /** Unkwow error */
64 #define EUNKNOW  127
65
66 /* must not be > 127 because it can be stored on an int8_t */
67
68 #else /* HOST_VERSION */
69 #include <sys/errno.h>
70
71 #endif /* HOST_VERSION */
72
73 #endif /* AVERSIVE_ERRNO_H_ */