1 /* Test of <errno.h> substitute.
2 Copyright (C) 2008-2018 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 /* Written by Bruno Haible <bruno@clisp.org>, 2008. */
23 /* Verify that the POSIX mandated errno values exist and can be used as
24 initializers outside of a function.
25 The variable names happen to match the Linux/x86 error numbers. */
37 int e11a
= EWOULDBLOCK
;
61 int e36
= ENAMETOOLONG
;
75 int e89
= EDESTADDRREQ
;
78 int e92
= ENOPROTOOPT
;
79 int e93
= EPROTONOSUPPORT
;
82 int e97
= EAFNOSUPPORT
;
84 int e99
= EADDRNOTAVAIL
;
86 int e101
= ENETUNREACH
;
88 int e103
= ECONNABORTED
;
89 int e104
= ECONNRESET
;
94 int e111
= ECONNREFUSED
;
95 int e113
= EHOSTUNREACH
;
97 int e115
= EINPROGRESS
;
100 int e125
= ECANCELED
;
101 int e130
= EOWNERDEAD
;
102 int e131
= ENOTRECOVERABLE
;
104 /* Don't verify that these errno values are all different, except for possibly
105 EWOULDBLOCK == EAGAIN. Even Linux/x86 does not pass this check: it has
106 ENOTSUP == EOPNOTSUPP. */
111 /* Verify that errno can be assigned. */
114 /* snprintf() callers want to distinguish EINVAL and EOVERFLOW. */