errno.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Error constants. Generic version.
  2. Copyright (C) 1991-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. /* This file defines the errno constants. */
  16. #ifndef _BITS_ERRNO_H
  17. #define _BITS_ERRNO_H 1
  18. #if !defined _ERRNO_H
  19. # error "Never include <bits/errno.h> directly; use <errno.h> instead."
  20. #endif
  21. #error "Generic bits/errno.h included -- port is incomplete."
  22. /* Authors of new ports of the GNU C Library must override this file
  23. with their own bits/errno.h in an appropriate subdirectory of
  24. sysdeps/. Its function is to define all of the error constants
  25. from C2011 and POSIX.1-2008, with values appropriate to the
  26. operating system, and any additional OS-specific error constants.
  27. C2011 requires all error constants to be object-like macros that
  28. expand to "integer constant expressions with type int, positive
  29. values, and suitable for use in #if directives". Moreover, all of
  30. their names must begin with a capital E, followed immediately by
  31. either another capital letter, or a digit. It is OK to define
  32. macros that are not error constants, but only in the implementation
  33. namespace.
  34. errno.h is sometimes included from assembly language. Therefore,
  35. when __ASSEMBLER__ is defined, bits/errno.h may only define macros;
  36. it may not make any other kind of C declaration or definition.
  37. Also, the error constants should, if at all possible, expand to
  38. simple decimal or hexadecimal numbers. */
  39. #endif /* bits/errno.h. */