1 1.1 christos /* A POSIX-like <errno.h>. 2 1.1 christos 3 1.1.1.2 christos Copyright (C) 2008-2022 Free Software Foundation, Inc. 4 1.1 christos 5 1.1.1.2 christos This file is free software: you can redistribute it and/or modify 6 1.1.1.2 christos it under the terms of the GNU Lesser General Public License as 7 1.1.1.2 christos published by the Free Software Foundation; either version 2.1 of the 8 1.1.1.2 christos License, or (at your option) any later version. 9 1.1 christos 10 1.1.1.2 christos This file is distributed in the hope that it will be useful, 11 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of 12 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 1.1.1.2 christos GNU Lesser General Public License for more details. 14 1.1 christos 15 1.1.1.2 christos You should have received a copy of the GNU Lesser General Public License 16 1.1.1.2 christos along with this program. If not, see <https://www.gnu.org/licenses/>. */ 17 1.1 christos 18 1.1 christos #ifndef _@GUARD_PREFIX@_ERRNO_H 19 1.1 christos 20 1.1 christos #if __GNUC__ >= 3 21 1.1 christos @PRAGMA_SYSTEM_HEADER@ 22 1.1 christos #endif 23 1.1 christos @PRAGMA_COLUMNS@ 24 1.1 christos 25 1.1 christos /* The include_next requires a split double-inclusion guard. */ 26 1.1 christos #@INCLUDE_NEXT@ @NEXT_ERRNO_H@ 27 1.1 christos 28 1.1 christos #ifndef _@GUARD_PREFIX@_ERRNO_H 29 1.1 christos #define _@GUARD_PREFIX@_ERRNO_H 30 1.1 christos 31 1.1 christos 32 1.1 christos /* On native Windows platforms, many macros are not defined. */ 33 1.1 christos # if defined _WIN32 && ! defined __CYGWIN__ 34 1.1 christos 35 1.1 christos /* These are the same values as defined by MSVC 10, for interoperability. */ 36 1.1 christos 37 1.1 christos # ifndef ENOMSG 38 1.1 christos # define ENOMSG 122 39 1.1 christos # define GNULIB_defined_ENOMSG 1 40 1.1 christos # endif 41 1.1 christos 42 1.1 christos # ifndef EIDRM 43 1.1 christos # define EIDRM 111 44 1.1 christos # define GNULIB_defined_EIDRM 1 45 1.1 christos # endif 46 1.1 christos 47 1.1 christos # ifndef ENOLINK 48 1.1 christos # define ENOLINK 121 49 1.1 christos # define GNULIB_defined_ENOLINK 1 50 1.1 christos # endif 51 1.1 christos 52 1.1 christos # ifndef EPROTO 53 1.1 christos # define EPROTO 134 54 1.1 christos # define GNULIB_defined_EPROTO 1 55 1.1 christos # endif 56 1.1 christos 57 1.1 christos # ifndef EBADMSG 58 1.1 christos # define EBADMSG 104 59 1.1 christos # define GNULIB_defined_EBADMSG 1 60 1.1 christos # endif 61 1.1 christos 62 1.1 christos # ifndef EOVERFLOW 63 1.1 christos # define EOVERFLOW 132 64 1.1 christos # define GNULIB_defined_EOVERFLOW 1 65 1.1 christos # endif 66 1.1 christos 67 1.1 christos # ifndef ENOTSUP 68 1.1 christos # define ENOTSUP 129 69 1.1 christos # define GNULIB_defined_ENOTSUP 1 70 1.1 christos # endif 71 1.1 christos 72 1.1 christos # ifndef ENETRESET 73 1.1 christos # define ENETRESET 117 74 1.1 christos # define GNULIB_defined_ENETRESET 1 75 1.1 christos # endif 76 1.1 christos 77 1.1 christos # ifndef ECONNABORTED 78 1.1 christos # define ECONNABORTED 106 79 1.1 christos # define GNULIB_defined_ECONNABORTED 1 80 1.1 christos # endif 81 1.1 christos 82 1.1 christos # ifndef ECANCELED 83 1.1 christos # define ECANCELED 105 84 1.1 christos # define GNULIB_defined_ECANCELED 1 85 1.1 christos # endif 86 1.1 christos 87 1.1 christos # ifndef EOWNERDEAD 88 1.1 christos # define EOWNERDEAD 133 89 1.1 christos # define GNULIB_defined_EOWNERDEAD 1 90 1.1 christos # endif 91 1.1 christos 92 1.1 christos # ifndef ENOTRECOVERABLE 93 1.1 christos # define ENOTRECOVERABLE 127 94 1.1 christos # define GNULIB_defined_ENOTRECOVERABLE 1 95 1.1 christos # endif 96 1.1 christos 97 1.1 christos # ifndef EINPROGRESS 98 1.1 christos # define EINPROGRESS 112 99 1.1 christos # define EALREADY 103 100 1.1 christos # define ENOTSOCK 128 101 1.1 christos # define EDESTADDRREQ 109 102 1.1 christos # define EMSGSIZE 115 103 1.1 christos # define EPROTOTYPE 136 104 1.1 christos # define ENOPROTOOPT 123 105 1.1 christos # define EPROTONOSUPPORT 135 106 1.1 christos # define EOPNOTSUPP 130 107 1.1 christos # define EAFNOSUPPORT 102 108 1.1 christos # define EADDRINUSE 100 109 1.1 christos # define EADDRNOTAVAIL 101 110 1.1 christos # define ENETDOWN 116 111 1.1 christos # define ENETUNREACH 118 112 1.1 christos # define ECONNRESET 108 113 1.1 christos # define ENOBUFS 119 114 1.1 christos # define EISCONN 113 115 1.1 christos # define ENOTCONN 126 116 1.1 christos # define ETIMEDOUT 138 117 1.1 christos # define ECONNREFUSED 107 118 1.1 christos # define ELOOP 114 119 1.1 christos # define EHOSTUNREACH 110 120 1.1 christos # define EWOULDBLOCK 140 121 1.1 christos # define GNULIB_defined_ESOCK 1 122 1.1 christos # endif 123 1.1 christos 124 1.1 christos # ifndef ETXTBSY 125 1.1 christos # define ETXTBSY 139 126 1.1 christos # define ENODATA 120 /* not required by POSIX */ 127 1.1 christos # define ENOSR 124 /* not required by POSIX */ 128 1.1 christos # define ENOSTR 125 /* not required by POSIX */ 129 1.1 christos # define ETIME 137 /* not required by POSIX */ 130 1.1 christos # define EOTHER 131 /* not required by POSIX */ 131 1.1 christos # define GNULIB_defined_ESTREAMS 1 132 1.1 christos # endif 133 1.1 christos 134 1.1 christos /* These are intentionally the same values as the WSA* error numbers, defined 135 1.1 christos in <winsock2.h>. */ 136 1.1 christos # define ESOCKTNOSUPPORT 10044 /* not required by POSIX */ 137 1.1 christos # define EPFNOSUPPORT 10046 /* not required by POSIX */ 138 1.1 christos # define ESHUTDOWN 10058 /* not required by POSIX */ 139 1.1 christos # define ETOOMANYREFS 10059 /* not required by POSIX */ 140 1.1 christos # define EHOSTDOWN 10064 /* not required by POSIX */ 141 1.1 christos # define EPROCLIM 10067 /* not required by POSIX */ 142 1.1 christos # define EUSERS 10068 /* not required by POSIX */ 143 1.1 christos # define EDQUOT 10069 144 1.1 christos # define ESTALE 10070 145 1.1 christos # define EREMOTE 10071 /* not required by POSIX */ 146 1.1 christos # define GNULIB_defined_EWINSOCK 1 147 1.1 christos 148 1.1 christos # endif 149 1.1 christos 150 1.1 christos 151 1.1 christos /* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros 152 1.1 christos EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */ 153 1.1 christos # if @EMULTIHOP_HIDDEN@ 154 1.1 christos # define EMULTIHOP @EMULTIHOP_VALUE@ 155 1.1 christos # define GNULIB_defined_EMULTIHOP 1 156 1.1 christos # endif 157 1.1 christos # if @ENOLINK_HIDDEN@ 158 1.1 christos # define ENOLINK @ENOLINK_VALUE@ 159 1.1 christos # define GNULIB_defined_ENOLINK 1 160 1.1 christos # endif 161 1.1 christos # if @EOVERFLOW_HIDDEN@ 162 1.1 christos # define EOVERFLOW @EOVERFLOW_VALUE@ 163 1.1 christos # define GNULIB_defined_EOVERFLOW 1 164 1.1 christos # endif 165 1.1 christos 166 1.1 christos 167 1.1 christos /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK, 168 1.1 christos EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined. 169 1.1 christos Likewise, on NonStop Kernel, EDQUOT is not defined. 170 1.1 christos Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151, 171 1.1 christos HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133. 172 1.1 christos 173 1.1 christos Note: When one of these systems defines some of these macros some day, 174 1.1 christos binaries will have to be recompiled so that they recognizes the new 175 1.1 christos errno values from the system. */ 176 1.1 christos 177 1.1 christos # ifndef ENOMSG 178 1.1 christos # define ENOMSG 2000 179 1.1 christos # define GNULIB_defined_ENOMSG 1 180 1.1 christos # endif 181 1.1 christos 182 1.1 christos # ifndef EIDRM 183 1.1 christos # define EIDRM 2001 184 1.1 christos # define GNULIB_defined_EIDRM 1 185 1.1 christos # endif 186 1.1 christos 187 1.1 christos # ifndef ENOLINK 188 1.1 christos # define ENOLINK 2002 189 1.1 christos # define GNULIB_defined_ENOLINK 1 190 1.1 christos # endif 191 1.1 christos 192 1.1 christos # ifndef EPROTO 193 1.1 christos # define EPROTO 2003 194 1.1 christos # define GNULIB_defined_EPROTO 1 195 1.1 christos # endif 196 1.1 christos 197 1.1 christos # ifndef EMULTIHOP 198 1.1 christos # define EMULTIHOP 2004 199 1.1 christos # define GNULIB_defined_EMULTIHOP 1 200 1.1 christos # endif 201 1.1 christos 202 1.1 christos # ifndef EBADMSG 203 1.1 christos # define EBADMSG 2005 204 1.1 christos # define GNULIB_defined_EBADMSG 1 205 1.1 christos # endif 206 1.1 christos 207 1.1 christos # ifndef EOVERFLOW 208 1.1 christos # define EOVERFLOW 2006 209 1.1 christos # define GNULIB_defined_EOVERFLOW 1 210 1.1 christos # endif 211 1.1 christos 212 1.1 christos # ifndef ENOTSUP 213 1.1 christos # define ENOTSUP 2007 214 1.1 christos # define GNULIB_defined_ENOTSUP 1 215 1.1 christos # endif 216 1.1 christos 217 1.1 christos # ifndef ENETRESET 218 1.1 christos # define ENETRESET 2011 219 1.1 christos # define GNULIB_defined_ENETRESET 1 220 1.1 christos # endif 221 1.1 christos 222 1.1 christos # ifndef ECONNABORTED 223 1.1 christos # define ECONNABORTED 2012 224 1.1 christos # define GNULIB_defined_ECONNABORTED 1 225 1.1 christos # endif 226 1.1 christos 227 1.1 christos # ifndef ESTALE 228 1.1 christos # define ESTALE 2009 229 1.1 christos # define GNULIB_defined_ESTALE 1 230 1.1 christos # endif 231 1.1 christos 232 1.1 christos # ifndef EDQUOT 233 1.1 christos # define EDQUOT 2010 234 1.1 christos # define GNULIB_defined_EDQUOT 1 235 1.1 christos # endif 236 1.1 christos 237 1.1 christos # ifndef ECANCELED 238 1.1 christos # define ECANCELED 2008 239 1.1 christos # define GNULIB_defined_ECANCELED 1 240 1.1 christos # endif 241 1.1 christos 242 1.1 christos /* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not 243 1.1 christos defined. */ 244 1.1 christos 245 1.1 christos # ifndef EOWNERDEAD 246 1.1 christos # if defined __sun 247 1.1 christos /* Use the same values as defined for Solaris >= 8, for 248 1.1 christos interoperability. */ 249 1.1 christos # define EOWNERDEAD 58 250 1.1 christos # define ENOTRECOVERABLE 59 251 1.1 christos # elif defined _WIN32 && ! defined __CYGWIN__ 252 1.1 christos /* We have a conflict here: pthreads-win32 defines these values 253 1.1 christos differently than MSVC 10. It's hairy to decide which one to use. */ 254 1.1 christos # if defined __MINGW32__ && !defined USE_WINDOWS_THREADS 255 1.1 christos /* Use the same values as defined by pthreads-win32, for 256 1.1 christos interoperability. */ 257 1.1 christos # define EOWNERDEAD 43 258 1.1 christos # define ENOTRECOVERABLE 44 259 1.1 christos # else 260 1.1 christos /* Use the same values as defined by MSVC 10, for 261 1.1 christos interoperability. */ 262 1.1 christos # define EOWNERDEAD 133 263 1.1 christos # define ENOTRECOVERABLE 127 264 1.1 christos # endif 265 1.1 christos # else 266 1.1 christos # define EOWNERDEAD 2013 267 1.1 christos # define ENOTRECOVERABLE 2014 268 1.1 christos # endif 269 1.1 christos # define GNULIB_defined_EOWNERDEAD 1 270 1.1 christos # define GNULIB_defined_ENOTRECOVERABLE 1 271 1.1 christos # endif 272 1.1 christos 273 1.1 christos # ifndef EILSEQ 274 1.1 christos # define EILSEQ 2015 275 1.1 christos # define GNULIB_defined_EILSEQ 1 276 1.1 christos # endif 277 1.1 christos 278 1.1 christos #endif /* _@GUARD_PREFIX@_ERRNO_H */ 279 1.1 christos #endif /* _@GUARD_PREFIX@_ERRNO_H */ 280