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