Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
errno.h
Go to the documentation of this file.
1 #ifndef ERRNO_H__
2 #define ERRNO_H__
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 // TODO:
9 // int *__errno_location(void);
10 //#define errno (*__errno_location())
11 
12 extern int errno;
13 
14 #define EPERM 1 /* Operation not permitted */
15 #define ENOENT 2 /* No such file or directory */
16 #define ESRCH 3 /* No such process */
17 #define EINTR 4 /* Interrupted system call */
18 #define EIO 5 /* Input/output error */
19 #define ENXIO 6 /* Device not configured */
20 #define E2BIG 7 /* Argument list too long */
21 #define ENOEXEC 8 /* Exec format error */
22 #define EBADF 9 /* Bad file descriptor */
23 #define ECHILD 10 /* No child processes */
24 #define EDEADLK 11 /* Resource deadlock avoided */
25 /* 11 was EAGAIN */
26 #define ENOMEM 12 /* Cannot allocate memory */
27 #define EACCES 13 /* Permission denied */
28 #define EFAULT 14 /* Bad address */
29 #define ENOTBLK 15 /* Block device required */
30 #define EBUSY 16 /* Device / Resource busy */
31 #define EEXIST 17 /* File exists */
32 #define EXDEV 18 /* Cross-device link */
33 #define ENODEV 19 /* Operation not supported by device */
34 #define ENOTDIR 20 /* Not a directory */
35 #define EISDIR 21 /* Is a directory */
36 #define EINVAL 22 /* Invalid argument */
37 #define ENFILE 23 /* Too many open files in system */
38 #define EMFILE 24 /* Too many open files */
39 #define ENOTTY 25 /* Inappropriate ioctl for device */
40 #define ETXTBSY 26 /* Text file busy */
41 #define EFBIG 27 /* File too large */
42 #define ENOSPC 28 /* No space left on device */
43 #define ESPIPE 29 /* Illegal seek */
44 #define EROFS 30 /* Read-only file system */
45 #define EMLINK 31 /* Too many links */
46 #define EPIPE 32 /* Broken pipe */
47 
48 /* math software */
49 #define EDOM 33 /* Numerical argument out of domain */
50 #define ERANGE 34 /* Result too large */
51 
52 /* non-blocking and interrupt i/o */
53 #define EAGAIN 35 /* Resource temporarily unavailable */
54 #define EWOULDBLOCK EAGAIN /* Operation would block */
55 #define EINPROGRESS 36 /* Operation now in progress */
56 #define EALREADY 37 /* Operation already in progress */
57 
58 /* ipc/network software -- argument errors */
59 #define ENOTSOCK 38 /* Socket operation on non-socket */
60 #define EDESTADDRREQ 39 /* Destination address required */
61 #define EMSGSIZE 40 /* Message too long */
62 #define EPROTOTYPE 41 /* Protocol wrong type for socket */
63 #define ENOPROTOOPT 42 /* Protocol not available */
64 #define EPROTONOSUPPORT 43 /* Protocol not supported */
65 #define ESOCKTNOSUPPORT 44 /* Socket type not supported */
66 #define ENOTSUP 45 /* Operation not supported */
67 #define EOPNOTSUPP ENOTSUP /* Operation not supported on socket */
68 #define EPFNOSUPPORT 46 /* Protocol family not supported */
69 #define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
70 #define EADDRINUSE 48 /* Address already in use */
71 #define EADDRNOTAVAIL 49 /* Can't assign requested address */
72 
73 /* ipc/network software -- operational errors */
74 #define ENETDOWN 50 /* Network is down */
75 #define ENETUNREACH 51 /* Network is unreachable */
76 #define ENETRESET 52 /* Network dropped connection on reset */
77 #define ECONNABORTED 53 /* Software caused connection abort */
78 #define ECONNRESET 54 /* Connection reset by peer */
79 #define ENOBUFS 55 /* No buffer space available */
80 #define EISCONN 56 /* Socket is already connected */
81 #define ENOTCONN 57 /* Socket is not connected */
82 #define ESHUTDOWN 58 /* Can't send after socket shutdown */
83 #define ETOOMANYREFS 59 /* Too many references: can't splice */
84 #define ETIMEDOUT 60 /* Operation timed out */
85 #define ECONNREFUSED 61 /* Connection refused */
86 #define ELOOP 62 /* Too many levels of symbolic links */
87 #define ENAMETOOLONG 63 /* File name too long */
88 
89 /* should be rearranged */
90 #define EHOSTDOWN 64 /* Host is down */
91 #define EHOSTUNREACH 65 /* No route to host */
92 #define ENOTEMPTY 66 /* Directory not empty */
93 
94 /* quotas & mush */
95 #define EPROCLIM 67 /* Too many processes */
96 #define EUSERS 68 /* Too many users */
97 #define EDQUOT 69 /* Disc quota exceeded */
98 
99 /* Network File System */
100 #define ESTALE 70 /* Stale NFS file handle */
101 #define EREMOTE 71 /* Too many levels of remote in path */
102 #define EBADRPC 72 /* RPC struct is bad */
103 #define ERPCMISMATCH 73 /* RPC version wrong */
104 #define EPROGUNAVAIL 74 /* RPC prog. not avail */
105 #define EPROGMISMATCH 75 /* Program version wrong */
106 #define EPROCUNAVAIL 76 /* Bad procedure for program */
107 #define ENOLCK 77 /* No locks available */
108 #define ENOSYS 78 /* Function not implemented */
109 #define EFTYPE 79 /* Inappropriate file type or format */
110 #define EAUTH 80 /* Authentication error */
111 #define ENEEDAUTH 81 /* Need authenticator */
112 
113 /* Intelligent device errors */
114 #define EPWROFF 82 /* Device power is off */
115 #define EDEVERR 83 /* Device error, e.g. paper out */
116 #define EOVERFLOW 84 /* Value too large to be stored in data type */
117 
118 /* Program loading errors */
119 #define EBADEXEC 85 /* Bad executable */
120 #define EBADARCH 86 /* Bad CPU type in executable */
121 #define ESHLIBVERS 87 /* Shared library version mismatch */
122 #define EBADMACHO 88 /* Malformed Macho file */
123 #define ECANCELED 89 /* Operation canceled */
124 #define EIDRM 90 /* Identifier removed */
125 #define ENOMSG 91 /* No message of desired type */
126 #define EILSEQ 92 /* Illegal byte sequence */
127 #define ENOATTR 93 /* Attribute not found */
128 #define EBADMSG 94 /* Bad message */
129 #define EMULTIHOP 95 /* Reserved */
130 #define ENODATA 96 /* No message available on STREAM */
131 #define ENOLINK 97 /* Reserved */
132 #define ENOSR 98 /* No STREAM resources */
133 #define ENOSTR 99 /* Not a STREAM */
134 #define EPROTO 100 /* Protocol error */
135 #define ETIME 101 /* STREAM ioctl timeout */
136 #define ENOPOLICY 103 /* No such policy registered */
137 #define ENOTRECOVERABLE 104 /* State not recoverable */
138 #define EOWNERDEAD 105 /* Previous owner died */
139 #define EQFULL 106 /* Interface output queue is full */
140 #define ELAST 106 /* Must be equal largest errno */
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif // ERRNO_H__
int errno