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