]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/errno.h
Update or add comments to files and functions for use by Doxygen.
[mirror_edk2.git] / StdLib / Include / errno.h
index 9c6e071a2a5c0b5ed59414be6b36626841af2997..4989d4d150965a2f6617bd7d9549a3b71b211579 100644 (file)
@@ -1,28 +1,43 @@
 /** @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 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.\r
+\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; 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 - 2011, 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
@@ -38,42 +53,42 @@ extern  RETURN_STATUS   EFIerrno;
 \r
 #define EMINERRORVAL      __EMINERRORVAL          /* 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
-#define ESRCH             __ESRCH                 /*  3   No such process */\r
-#define EINTR             __EINTR                 /*  4   Interrupted system call */\r
-#define EIO               __EIO                   /*  5   Input/output error */\r
-#define ENXIO             __ENXIO                 /*  6   Device not configured */\r
-#define E2BIG             __E2BIG                 /*  7   Argument list too long */\r
-#define ENOEXEC           __ENOEXEC               /*  8   Exec format error */\r
-#define EBADF             __EBADF                 /*  9   Bad file descriptor */\r
-#define ECHILD            __ECHILD                /* 10   No child processes */\r
-#define EDEADLK           __EDEADLK               /* 11   Resource deadlock avoided */\r
-#define ENOMEM            __ENOMEM                /* 12   Cannot allocate memory */\r
-#define EACCES            __EACCES                /* 13   Permission denied */\r
-#define EFAULT            __EFAULT                /* 14   Bad address */\r
-#define ENOTBLK           __ENOTBLK               /* 15   Block device required */\r
-#define EBUSY             __EBUSY                 /* 16   Device busy */\r
-#define EEXIST            __EEXIST                /* 17   File exists */\r
-#define EXDEV             __EXDEV                 /* 18   Cross-device link */\r
-#define ENODEV            __ENODEV                /* 19   Operation not supported by device */\r
-#define ENOTDIR           __ENOTDIR               /* 20   Not a directory */\r
-#define EISDIR            __EISDIR                /* 21   Is a directory */\r
-#define EINVAL            __EINVAL                /* 22   Invalid argument */\r
-#define ENFILE            __ENFILE                /* 23   Too many open files in system */\r
-#define EMFILE            __EMFILE                /* 24   Too many open file descriptors */\r
-#define ENOTTY            __ENOTTY                /* 25   Inappropriate ioctl for device */\r
-#define ETXTBSY           __ETXTBSY               /* 26   Text file busy */\r
-#define EFBIG             __EFBIG                 /* 27   File too large */\r
-#define ENOSPC            __ENOSPC                /* 28   No space left on device */\r
-#define ESPIPE            __ESPIPE                /* 29   Illegal seek */\r
-#define EROFS             __EROFS                 /* 30   Read-only filesystem */\r
-#define EMLINK            __EMLINK                /* 31   Too many links */\r
-#define EPIPE             __EPIPE                 /* 32   Broken pipe */\r
+#define EPERM             __EPERM                 /* Operation not permitted */\r
+#define ENOENT            __ENOENT                /* No such file or directory */\r
+#define ESRCH             __ESRCH                 /* No such process */\r
+#define EINTR             __EINTR                 /* Interrupted system call */\r
+#define EIO               __EIO                   /* Input/output error */\r
+#define ENXIO             __ENXIO                 /* Device not configured */\r
+#define E2BIG             __E2BIG                 /* Argument list too long */\r
+#define ENOEXEC           __ENOEXEC               /* Exec format error */\r
+#define EBADF             __EBADF                 /* Bad file descriptor */\r
+#define ECHILD            __ECHILD                /* No child processes */\r
+#define EDEADLK           __EDEADLK               /* Resource deadlock avoided */\r
+#define ENOMEM            __ENOMEM                /* Cannot allocate memory */\r
+#define EACCES            __EACCES                /* Permission denied */\r
+#define EFAULT            __EFAULT                /* Bad address */\r
+#define ENOTBLK           __ENOTBLK               /* Block device required */\r
+#define EBUSY             __EBUSY                 /* Device busy */\r
+#define EEXIST            __EEXIST                /* File exists */\r
+#define EXDEV             __EXDEV                 /* Cross-device link */\r
+#define ENODEV            __ENODEV                /* Operation not supported by device */\r
+#define ENOTDIR           __ENOTDIR               /* Not a directory */\r
+#define EISDIR            __EISDIR                /* Is a directory */\r
+#define EINVAL            __EINVAL                /* Invalid argument */\r
+#define ENFILE            __ENFILE                /* Too many open files in system */\r
+#define EMFILE            __EMFILE                /* Too many open file descriptors */\r
+#define ENOTTY            __ENOTTY                /* Inappropriate ioctl for device */\r
+#define ETXTBSY           __ETXTBSY               /* Text file busy */\r
+#define EFBIG             __EFBIG                 /* File too large */\r
+#define ENOSPC            __ENOSPC                /* No space left on device */\r
+#define ESPIPE            __ESPIPE                /* Illegal seek */\r
+#define EROFS             __EROFS                 /* Read-only filesystem */\r
+#define EMLINK            __EMLINK                /* Too many links */\r
+#define EPIPE             __EPIPE                 /* Broken pipe */\r
 \r
 /* math software -- these are the only two values required by the C Standard */\r
-#define EDOM              __EDOM                  /* 33   Numerical argument out of domain */\r
-#define ERANGE            __ERANGE                /* 34   Result too large */\r
+#define EDOM              __EDOM                  /* 3umerical argument out of domain */\r
+#define ERANGE            __ERANGE                /* 3esult too large */\r
 \r
 /* non-blocking and interrupt i/o */\r
 #define EAGAIN            __EAGAIN                /* 35   Resource temporarily unavailable */\r