1 /* Test of <errno.h> substitute.
2 Copyright (C) 2008-2011 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 <http://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;
102 /* Don't verify that these errno values are all different, except for possibly
103 EWOULDBLOCK == EAGAIN. Even Linux/x86 does not pass this check: it has
104 ENOTSUP == EOPNOTSUPP. */
109 /* Verify that errno can be assigned. */
112 /* snprintf() callers want to distinguish EINVAL and EOVERFLOW. */