]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/errno.h
StdLib: Remove EfiSocketLib and Ip4Config Protocol dependency.
[mirror_edk2.git] / StdLib / Include / errno.h
index f6d97bb9e5c7a3dd37ccc4955fd9925843a84056..a819d0849cfdda844b91a9ff54356d1fb9854c00 100644 (file)
@@ -1,28 +1,39 @@
 /** @file\r
-  The header <errno.h> defines several values, all relating to the reporting of\r
+  The header <errno.h> defines several macros, all relating to the reporting of\r
   error conditions.\r
 \r
-  The enum members expand to integral constant expressions\r
+  The ISO/IEC 9899 specification requires that these be macros.\r
+\r
+  The macros expand to integral constant expressions\r
   with distinct nonzero values, suitable for use in #if preprocessing\r
-  directives; and errno which expands to a modifiable lvalue that has type int,\r
+  directives; the variable errno which expands to a modifiable lvalue that has type int,\r
   the value of which is set to a positive error number by several library\r
-  functions.\r
+  functions; and the variable EFIerrno which is an extension allowing the return status\r
+  of the underlying UEFI functions to be returned.\r
 \r
-  The value of errno is zero at program startup, but is never set to zero by\r
+  The value of errno and EFIerrno is zero at program startup.  On program startup, errno\r
+  is initialized to zero but is never set to zero by\r
   any library function.  The value of errno may be set to a non-zero value by\r
   a library function call whether or not there is an error, provided the use\r
-  of errno is not is not documented in the description of the function in\r
-  the governing standard: ISO/IEC 9899:1990 with Amendment 1 or ISO/IEC 9899:1999.\r
+  of errno is not documented in the description of the function in\r
+  the governing standard: ISO/IEC 9899:1990 with Amendment 1 or ISO/IEC 9899:199409.\r
+\r
+  EFIerrno, like errno, should only be checked if it is known that the preceeding function call\r
+  called a UEFI function.  Functions in which UEFI functions are called dependent upon context\r
+  or parameter values should guarantee that EFIerrno is set to zero by default, or to the status\r
+  value returned by any UEFI functions which are called.\r
 \r
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under\r
-the terms and conditions of the BSD License that accompanies this distribution.\r
-The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php.\r
+  All macro definitions in this list must begin with the letter 'E'\r
+  and be followed by a digit or an uppercase letter.\r
 \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials are licensed and made available under\r
+  the terms and conditions of the BSD License that accompanies this distribution.\r
+  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.\r
 \r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 **/\r
 #ifndef _ERRNO_H\r
 #define _ERRNO_H\r
@@ -34,7 +45,10 @@ extern  RETURN_STATUS   EFIerrno;
 \r
 // Define error number in terms of the ENUM in <sys/errno.h>\r
 \r
-#define EMINERRORVAL      __EMINERRORVAL          /* The lowest valid error value */\r
+#define ERESTART          -1                      /* restart syscall */\r
+#define ESUCCESS          __ESUCCESS              /* No Problems */\r
+\r
+#define EMINERRORVAL      __EMINERRORVAL          /*  1   The lowest valid error value */\r
 \r
 #define EPERM             __EPERM                 /*  1   Operation not permitted */\r
 #define ENOENT            __ENOENT                /*  2   No such file or directory */\r