1 /* A POSIX-like <errno.h>.
3 Copyright (C) 2008-2024 Free Software Foundation, Inc.
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 This file 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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 #ifndef _@GUARD_PREFIX@_ERRNO_H
21 @PRAGMA_SYSTEM_HEADER@
25 /* The include_next requires a split double-inclusion guard. */
26 #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
28 #ifndef _@GUARD_PREFIX@_ERRNO_H
29 #define _@GUARD_PREFIX@_ERRNO_H
32 /* On native Windows platforms, many macros are not defined. */
33 # if defined _WIN32 && ! defined __CYGWIN__
35 /* These are the same values as defined by MSVC 10, for interoperability. */
39 # define GNULIB_defined_ENOMSG 1
44 # define GNULIB_defined_EIDRM 1
49 # define GNULIB_defined_ENOLINK 1
54 # define GNULIB_defined_EPROTO 1
59 # define GNULIB_defined_EBADMSG 1
63 # define EOVERFLOW 132
64 # define GNULIB_defined_EOVERFLOW 1
69 # define GNULIB_defined_ENOTSUP 1
73 # define ENETRESET 117
74 # define GNULIB_defined_ENETRESET 1
78 # define ECONNABORTED 106
79 # define GNULIB_defined_ECONNABORTED 1
83 # define ECANCELED 105
84 # define GNULIB_defined_ECANCELED 1
88 # define EOWNERDEAD 133
89 # define GNULIB_defined_EOWNERDEAD 1
92 # ifndef ENOTRECOVERABLE
93 # define ENOTRECOVERABLE 127
94 # define GNULIB_defined_ENOTRECOVERABLE 1
98 # define EINPROGRESS 112
100 # define ENOTSOCK 128
101 # define EDESTADDRREQ 109
102 # define EMSGSIZE 115
103 # define EPROTOTYPE 136
104 # define ENOPROTOOPT 123
105 # define EPROTONOSUPPORT 135
106 # define EOPNOTSUPP 130
107 # define EAFNOSUPPORT 102
108 # define EADDRINUSE 100
109 # define EADDRNOTAVAIL 101
110 # define ENETDOWN 116
111 # define ENETUNREACH 118
112 # define ECONNRESET 108
115 # define ENOTCONN 126
116 # define ETIMEDOUT 138
117 # define ECONNREFUSED 107
119 # define EHOSTUNREACH 110
120 # define EWOULDBLOCK 140
121 # define GNULIB_defined_ESOCK 1
126 # define ENODATA 120 /* not required by POSIX */
127 # define ENOSR 124 /* not required by POSIX */
128 # define ENOSTR 125 /* not required by POSIX */
129 # define ETIME 137 /* not required by POSIX */
130 # define EOTHER 131 /* not required by POSIX */
131 # define GNULIB_defined_ESTREAMS 1
134 /* These are intentionally the same values as the WSA* error numbers, defined
136 # define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
137 # define EPFNOSUPPORT 10046 /* not required by POSIX */
138 # define ESHUTDOWN 10058 /* not required by POSIX */
139 # define ETOOMANYREFS 10059 /* not required by POSIX */
140 # define EHOSTDOWN 10064 /* not required by POSIX */
141 # define EPROCLIM 10067 /* not required by POSIX */
142 # define EUSERS 10068 /* not required by POSIX */
143 # define EDQUOT 10069
144 # define ESTALE 10070
145 # define EREMOTE 10071 /* not required by POSIX */
146 # define GNULIB_defined_EWINSOCK 1
151 /* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
152 EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
153 # if @EMULTIHOP_HIDDEN@
154 # define EMULTIHOP @EMULTIHOP_VALUE@
155 # define GNULIB_defined_EMULTIHOP 1
157 # if @ENOLINK_HIDDEN@
158 # define ENOLINK @ENOLINK_VALUE@
159 # define GNULIB_defined_ENOLINK 1
161 # if @EOVERFLOW_HIDDEN@
162 # define EOVERFLOW @EOVERFLOW_VALUE@
163 # define GNULIB_defined_EOVERFLOW 1
167 /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
168 EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
169 Likewise, on NonStop Kernel, EDQUOT is not defined.
170 Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
171 HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
173 Note: When one of these systems defines some of these macros some day,
174 binaries will have to be recompiled so that they recognizes the new
175 errno values from the system. */
179 # define GNULIB_defined_ENOMSG 1
184 # define GNULIB_defined_EIDRM 1
188 # define ENOLINK 2002
189 # define GNULIB_defined_ENOLINK 1
194 # define GNULIB_defined_EPROTO 1
198 # define EMULTIHOP 2004
199 # define GNULIB_defined_EMULTIHOP 1
203 # define EBADMSG 2005
204 # define GNULIB_defined_EBADMSG 1
208 # define EOVERFLOW 2006
209 # define GNULIB_defined_EOVERFLOW 1
213 # define ENOTSUP 2007
214 # define GNULIB_defined_ENOTSUP 1
218 # define ENETRESET 2011
219 # define GNULIB_defined_ENETRESET 1
222 # ifndef ECONNABORTED
223 # define ECONNABORTED 2012
224 # define GNULIB_defined_ECONNABORTED 1
229 # define GNULIB_defined_ESTALE 1
234 # define GNULIB_defined_EDQUOT 1
238 # define ECANCELED 2008
239 # define GNULIB_defined_ECANCELED 1
242 /* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
247 /* Use the same values as defined for Solaris >= 8, for
249 # define EOWNERDEAD 58
250 # define ENOTRECOVERABLE 59
251 # elif defined _WIN32 && ! defined __CYGWIN__
252 /* We have a conflict here: pthreads-win32 defines these values
253 differently than MSVC 10. It's hairy to decide which one to use. */
254 # if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
255 /* Use the same values as defined by pthreads-win32, for
257 # define EOWNERDEAD 43
258 # define ENOTRECOVERABLE 44
260 /* Use the same values as defined by MSVC 10, for
262 # define EOWNERDEAD 133
263 # define ENOTRECOVERABLE 127
266 # define EOWNERDEAD 2013
267 # define ENOTRECOVERABLE 2014
269 # define GNULIB_defined_EOWNERDEAD 1
270 # define GNULIB_defined_ENOTRECOVERABLE 1
275 # define GNULIB_defined_EILSEQ 1
278 #endif /* _@GUARD_PREFIX@_ERRNO_H */
279 #endif /* _@GUARD_PREFIX@_ERRNO_H */