]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/Include/errno.h
Fix GCC build errors.
[mirror_edk2.git] / StdLib / Include / errno.h
1 /** @file
2 The header <errno.h> defines several macros, all relating to the reporting of
3 error conditions.
4
5 The macros expand to integral constant expressions
6 with distinct nonzero values, suitable for use in #if preprocessing
7 directives.
8
9 The ISO/IEC 9899 specification requires that these be macros.
10
11 The macros expand to integral constant expressions
12 with distinct nonzero values, suitable for use in #if preprocessing
13 directives; the variable errno which expands to a modifiable lvalue that has type int,
14 the value of which is set to a positive error number by several library
15 functions; and the variable EFIerrno which is an extension allowing the return status
16 of the underlying UEFI functions to be returned.
17
18 The value of errno and EFIerrno is zero at program startup. On program startup, errno
19 is initialized to zero but is never set to zero by
20 any library function. The value of errno may be set to a non-zero value by
21 a library function call whether or not there is an error, provided the use
22 of errno is not documented in the description of the function in
23 the governing standard: ISO/IEC 9899:1990 with Amendment 1 or ISO/IEC 9899:199409.
24
25 EFIerrno, like errno, should only be checked if it is known that the preceeding function call
26 called a UEFI function. Functions in which UEFI functions are called dependent upon context
27 or parameter values should guarantee that EFIerrno is set to zero by default, or to the status
28 value returned by any UEFI functions which are called.
29
30 All macro definitions in this list must begin with the letter 'E'
31 and be followed by a digit or an uppercase letter.
32
33 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
34 This program and the accompanying materials are licensed and made available under
35 the terms and conditions of the BSD License that accompanies this distribution.
36 The full text of the license may be found at
37 http://opensource.org/licenses/bsd-license.
38
39 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
40 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
41 **/
42 #ifndef _ERRNO_H
43 #define _ERRNO_H
44 #include <sys/EfiCdefs.h>
45 #include <sys/errno.h>
46
47 extern int errno;
48 extern RETURN_STATUS EFIerrno;
49
50 // Define error number in terms of the ENUM in <sys/errno.h>
51
52 #define ERESTART -1 /* restart syscall */
53
54 #define EMINERRORVAL __EMINERRORVAL /* The lowest valid error value */
55
56 #define EPERM __EPERM /* Operation not permitted */
57 #define ENOENT __ENOENT /* No such file or directory */
58 #define ESRCH __ESRCH /* No such process */
59 #define EINTR __EINTR /* Interrupted system call */
60 #define EIO __EIO /* Input/output error */
61 #define ENXIO __ENXIO /* Device not configured */
62 #define E2BIG __E2BIG /* Argument list too long */
63 #define ENOEXEC __ENOEXEC /* Exec format error */
64 #define EBADF __EBADF /* Bad file descriptor */
65 #define ECHILD __ECHILD /* No child processes */
66 #define EDEADLK __EDEADLK /* Resource deadlock avoided */
67 #define ENOMEM __ENOMEM /* Cannot allocate memory */
68 #define EACCES __EACCES /* Permission denied */
69 #define EFAULT __EFAULT /* Bad address */
70 #define ENOTBLK __ENOTBLK /* Block device required */
71 #define EBUSY __EBUSY /* Device busy */
72 #define EEXIST __EEXIST /* File exists */
73 #define EXDEV __EXDEV /* Cross-device link */
74 #define ENODEV __ENODEV /* Operation not supported by device */
75 #define ENOTDIR __ENOTDIR /* Not a directory */
76 #define EISDIR __EISDIR /* Is a directory */
77 #define EINVAL __EINVAL /* Invalid argument */
78 #define ENFILE __ENFILE /* Too many open files in system */
79 #define EMFILE __EMFILE /* Too many open file descriptors */
80 #define ENOTTY __ENOTTY /* Inappropriate ioctl for device */
81 #define ETXTBSY __ETXTBSY /* Text file busy */
82 #define EFBIG __EFBIG /* File too large */
83 #define ENOSPC __ENOSPC /* No space left on device */
84 #define ESPIPE __ESPIPE /* Illegal seek */
85 #define EROFS __EROFS /* Read-only filesystem */
86 #define EMLINK __EMLINK /* Too many links */
87 #define EPIPE __EPIPE /* Broken pipe */
88
89 /* math software -- these are the only two values required by the C Standard */
90 #define EDOM __EDOM /* 3umerical argument out of domain */
91 #define ERANGE __ERANGE /* 3esult too large */
92
93 /* non-blocking and interrupt i/o */
94 #define EAGAIN __EAGAIN /* 35 Resource temporarily unavailable */
95 #define EWOULDBLOCK __EWOULDBLOCK /* 35 Operation would block */
96 #define EINPROGRESS __EINPROGRESS /* 36 Operation now in progress */
97 #define EALREADY __EALREADY /* 37 Operation already in progress */
98
99 /* ipc/network software -- argument errors */
100 #define ENOTSOCK __ENOTSOCK /* 38 Socket operation on non-socket */
101 #define EDESTADDRREQ __EDESTADDRREQ /* 39 Destination address required */
102 #define EMSGSIZE __EMSGSIZE /* 40 Message too long */
103 #define EPROTOTYPE __EPROTOTYPE /* 41 Protocol wrong type for socket */
104 #define ENOPROTOOPT __ENOPROTOOPT /* 42 Protocol not available */
105 #define EPROTONOSUPPORT __EPROTONOSUPPORT /* 43 Protocol not supported */
106 #define ESOCKTNOSUPPORT __ESOCKTNOSUPPORT /* 44 Socket type not supported */
107 #define EOPNOTSUPP __EOPNOTSUPP /* 45 Operation not supported */
108 #define ENOTSUP __ENOTSUP /* 45 Operation not supported */
109 #define EPFNOSUPPORT __EPFNOSUPPORT /* 46 Protocol family not supported */
110 #define EAFNOSUPPORT __EAFNOSUPPORT /* 47 Address family not supported by protocol family */
111 #define EADDRINUSE __EADDRINUSE /* 48 Address already in use */
112 #define EADDRNOTAVAIL __EADDRNOTAVAIL /* 49 Can't assign requested address */
113
114 /* ipc/network software -- operational errors */
115 #define ENETDOWN __ENETDOWN /* 50 Network is down */
116 #define ENETUNREACH __ENETUNREACH /* 51 Network is unreachable */
117 #define ENETRESET __ENETRESET /* 52 Network dropped connection on reset */
118 #define ECONNABORTED __ECONNABORTED /* 53 Software caused connection abort */
119 #define ECONNRESET __ECONNRESET /* 54 Connection reset by peer */
120 #define ENOBUFS __ENOBUFS /* 55 No buffer space available */
121 #define EISCONN __EISCONN /* 56 Socket is already connected */
122 #define ENOTCONN __ENOTCONN /* 57 Socket is not connected */
123 #define ESHUTDOWN __ESHUTDOWN /* 58 Can't send after socket shutdown */
124 #define ETOOMANYREFS __ETOOMANYREFS /* 59 Too many references: can't splice */
125 #define ETIMEDOUT __ETIMEDOUT /* 60 Operation timed out */
126 #define ECONNREFUSED __ECONNREFUSED /* 61 Connection refused */
127 #define ELOOP __ELOOP /* 62 Too many levels of symbolic links */
128 #define ENAMETOOLONG __ENAMETOOLONG /* 63 File name too long */
129 #define EHOSTDOWN __EHOSTDOWN /* 64 Host is down */
130 #define EHOSTUNREACH __EHOSTUNREACH /* 65 No route to host */
131
132 #define ENOTEMPTY __ENOTEMPTY /* 66 Directory not empty */
133
134 /* quotas, etc. */
135 #define EPROCLIM __EPROCLIM /* 67 Too many processes */
136 #define EUSERS __EUSERS /* 68 Too many users */
137 #define EDQUOT __EDQUOT /* 69 Disc quota exceeded */
138
139 /* Network File System */
140 #define ESTALE __ESTALE /* 70 Stale NFS file handle */
141 #define EREMOTE __EREMOTE /* 71 Too many levels of remote in path */
142 #define EBADRPC __EBADRPC /* 72 RPC struct is bad */
143 #define ERPCMISMATCH __ERPCMISMATCH /* 73 RPC version wrong */
144 #define EPROGUNAVAIL __EPROGUNAVAIL /* 74 RPC prog. not avail */
145 #define EPROGMISMATCH __EPROGMISMATCH /* 75 Program version wrong */
146 #define EPROCUNAVAIL __EPROCUNAVAIL /* 76 Bad procedure for program */
147 #define ENOLCK __ENOLCK /* 77 No locks available */
148 #define ENOSYS __ENOSYS /* 78 Function not implemented */
149 #define EFTYPE __EFTYPE /* 79 Inappropriate file type or format */
150 #define EAUTH __EAUTH /* 80 Authentication error */
151 #define ENEEDAUTH __ENEEDAUTH /* 81 Need authenticator */
152 #define EIDRM __EIDRM /* 82 Identifier removed */
153 #define ENOMSG __ENOMSG /* 83 No message of desired type */
154 #define EOVERFLOW __EOVERFLOW /* 84 Value too large to be stored in data type */
155 #define EILSEQ __EILSEQ /* 85 Illegal byte sequence */
156 #define ENOTHING_1 __ENOTHING_1 /* 86 Place Holder */
157 #define ECANCELED __ECANCELED /* 87 Operation canceled */
158
159 #define EBADMSG __EBADMSG /* 88 Bad message */
160 #define ENODATA __ENODATA /* 89 No message available */
161 #define ENOSR __ENOSR /* 90 No STREAM resources */
162 #define ENOSTR __ENOSTR /* 91 Not a STREAM */
163 #define ETIME __ETIME /* 92 STREAM ioctl timeout */
164
165 #define ENOATTR __ENOATTR /* 93 Attribute not found */
166
167 #define EDOOFUS __EDOOFUS /* 94 Programming error */
168
169 #define EMULTIHOP __EMULTIHOP /* 95 Multihop attempted */
170 #define ENOLINK __ENOLINK /* 96 Link has been severed */
171 #define EPROTO __EPROTO /* 97 Protocol error */
172
173 #define EBUFSIZE __EBUFSIZE /* 98 Buffer too small to hold result */
174
175 #define EMAXERRORVAL __EMAXERRORVAL /* One more than the highest defined error value. */
176
177 #endif /* _ERRNO_H */