1 /* A POSIX-like <errno.h>.
3 Copyright (C) 2008-2011 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
10 This program 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
19 #ifndef _@GUARD_PREFIX@_ERRNO_H
22 @PRAGMA_SYSTEM_HEADER@
26 /* The include_next requires a split double-inclusion guard. */
27 #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
29 #ifndef _@GUARD_PREFIX@_ERRNO_H
30 #define _@GUARD_PREFIX@_ERRNO_H
33 /* On native Windows platforms, many macros are not defined. */
34 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
36 /* These are the same values as defined by MSVC 10, for interoperability. */
40 # define GNULIB_defined_ENOMSG 1
45 # define GNULIB_defined_EIDRM 1
50 # define GNULIB_defined_ENOLINK 1
55 # define GNULIB_defined_EPROTO 1
60 # define GNULIB_defined_EBADMSG 1
64 # define EOVERFLOW 132
65 # define GNULIB_defined_EOVERFLOW 1
70 # define GNULIB_defined_ENOTSUP 1
74 # define ENETRESET 117
75 # define GNULIB_defined_ENETRESET 1
79 # define ECONNABORTED 106
80 # define GNULIB_defined_ECONNABORTED 1
84 # define ECANCELED 105
85 # define GNULIB_defined_ECANCELED 1
89 # define EINPROGRESS 112
92 # define EDESTADDRREQ 109
94 # define EPROTOTYPE 136
95 # define ENOPROTOOPT 123
96 # define EPROTONOSUPPORT 135
97 # define EOPNOTSUPP 130
98 # define EAFNOSUPPORT 102
99 # define EADDRINUSE 100
100 # define EADDRNOTAVAIL 101
101 # define ENETDOWN 116
102 # define ENETUNREACH 118
103 # define ECONNRESET 108
106 # define ENOTCONN 126
107 # define ETIMEDOUT 138
108 # define ECONNREFUSED 107
110 # define EHOSTUNREACH 110
111 # define EWOULDBLOCK 140
113 # define ENODATA 120 /* not required by POSIX */
114 # define ENOSR 124 /* not required by POSIX */
115 # define ENOSTR 125 /* not required by POSIX */
116 # define ENOTRECOVERABLE 127 /* not required by POSIX */
117 # define EOWNERDEAD 133 /* not required by POSIX */
118 # define ETIME 137 /* not required by POSIX */
119 # define EOTHER 131 /* not required by POSIX */
120 # define GNULIB_defined_ESOCK 1
123 /* These are intentionally the same values as the WSA* error numbers, defined
125 # define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
126 # define EPFNOSUPPORT 10046 /* not required by POSIX */
127 # define ESHUTDOWN 10058 /* not required by POSIX */
128 # define ETOOMANYREFS 10059 /* not required by POSIX */
129 # define EHOSTDOWN 10064 /* not required by POSIX */
130 # define EPROCLIM 10067 /* not required by POSIX */
131 # define EUSERS 10068 /* not required by POSIX */
132 # define EDQUOT 10069
133 # define ESTALE 10070
134 # define EREMOTE 10071 /* not required by POSIX */
135 # define GNULIB_defined_EWINSOCK 1
140 /* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
141 EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
142 # if @EMULTIHOP_HIDDEN@
143 # define EMULTIHOP @EMULTIHOP_VALUE@
144 # define GNULIB_defined_EMULTIHOP 1
146 # if @ENOLINK_HIDDEN@
147 # define ENOLINK @ENOLINK_VALUE@
148 # define GNULIB_defined_ENOLINK 1
150 # if @EOVERFLOW_HIDDEN@
151 # define EOVERFLOW @EOVERFLOW_VALUE@
152 # define GNULIB_defined_EOVERFLOW 1
156 /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
157 EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
158 Likewise, on NonStop Kernel, EDQUOT is not defined.
159 Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
160 HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
162 Note: When one of these systems defines some of these macros some day,
163 binaries will have to be recompiled so that they recognizes the new
164 errno values from the system. */
168 # define GNULIB_defined_ENOMSG 1
173 # define GNULIB_defined_EIDRM 1
177 # define ENOLINK 2002
178 # define GNULIB_defined_ENOLINK 1
183 # define GNULIB_defined_EPROTO 1
187 # define EMULTIHOP 2004
188 # define GNULIB_defined_EMULTIHOP 1
192 # define EBADMSG 2005
193 # define GNULIB_defined_EBADMSG 1
197 # define EOVERFLOW 2006
198 # define GNULIB_defined_EOVERFLOW 1
202 # define ENOTSUP 2007
203 # define GNULIB_defined_ENOTSUP 1
207 # define ENETRESET 2011
208 # define GNULIB_defined_ENETRESET 1
211 # ifndef ECONNABORTED
212 # define ECONNABORTED 2012
213 # define GNULIB_defined_ECONNABORTED 1
218 # define GNULIB_defined_ESTALE 1
223 # define GNULIB_defined_EDQUOT 1
227 # define ECANCELED 2008
228 # define GNULIB_defined_ECANCELED 1
232 #endif /* _@GUARD_PREFIX@_ERRNO_H */
233 #endif /* _@GUARD_PREFIX@_ERRNO_H */