Commit | Line | Data |
---|---|---|
c4b681fd LC |
1 | /* A POSIX-like <errno.h>. |
2 | ||
49114fd4 | 3 | Copyright (C) 2008-2011 Free Software Foundation, Inc. |
c4b681fd LC |
4 | |
5 | This program is free software; you can redistribute it and/or modify | |
6 | it under the terms of the GNU Lesser General Public License as published by | |
7 | the Free Software Foundation; either version 2, or (at your option) | |
8 | any later version. | |
9 | ||
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 Lesser General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU Lesser 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. */ | |
18 | ||
3d458a81 | 19 | #ifndef _@GUARD_PREFIX@_ERRNO_H |
c4b681fd LC |
20 | |
21 | #if __GNUC__ >= 3 | |
22 | @PRAGMA_SYSTEM_HEADER@ | |
23 | #endif | |
0f00f2c3 | 24 | @PRAGMA_COLUMNS@ |
c4b681fd LC |
25 | |
26 | /* The include_next requires a split double-inclusion guard. */ | |
27 | #@INCLUDE_NEXT@ @NEXT_ERRNO_H@ | |
28 | ||
3d458a81 AW |
29 | #ifndef _@GUARD_PREFIX@_ERRNO_H |
30 | #define _@GUARD_PREFIX@_ERRNO_H | |
c4b681fd LC |
31 | |
32 | ||
33 | /* On native Windows platforms, many macros are not defined. */ | |
34 | # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ | |
35 | ||
36 | /* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */ | |
37 | # define EWOULDBLOCK EAGAIN | |
38 | ||
39 | /* Values >= 100 seem safe to use. */ | |
40 | # define ETXTBSY 100 | |
41 | # define GNULIB_defined_ETXTBSY 1 | |
42 | ||
43 | /* These are intentionally the same values as the WSA* error numbers, defined | |
44 | in <winsock2.h>. */ | |
45 | # define EINPROGRESS 10036 | |
46 | # define EALREADY 10037 | |
47 | # define ENOTSOCK 10038 | |
48 | # define EDESTADDRREQ 10039 | |
49 | # define EMSGSIZE 10040 | |
50 | # define EPROTOTYPE 10041 | |
51 | # define ENOPROTOOPT 10042 | |
52 | # define EPROTONOSUPPORT 10043 | |
53 | # define ESOCKTNOSUPPORT 10044 /* not required by POSIX */ | |
54 | # define EOPNOTSUPP 10045 | |
55 | # define EPFNOSUPPORT 10046 /* not required by POSIX */ | |
56 | # define EAFNOSUPPORT 10047 | |
57 | # define EADDRINUSE 10048 | |
58 | # define EADDRNOTAVAIL 10049 | |
59 | # define ENETDOWN 10050 | |
60 | # define ENETUNREACH 10051 | |
61 | # define ENETRESET 10052 | |
62 | # define ECONNABORTED 10053 | |
63 | # define ECONNRESET 10054 | |
64 | # define ENOBUFS 10055 | |
65 | # define EISCONN 10056 | |
66 | # define ENOTCONN 10057 | |
67 | # define ESHUTDOWN 10058 /* not required by POSIX */ | |
68 | # define ETOOMANYREFS 10059 /* not required by POSIX */ | |
69 | # define ETIMEDOUT 10060 | |
70 | # define ECONNREFUSED 10061 | |
71 | # define ELOOP 10062 | |
72 | # define EHOSTDOWN 10064 /* not required by POSIX */ | |
73 | # define EHOSTUNREACH 10065 | |
74 | # define EPROCLIM 10067 /* not required by POSIX */ | |
75 | # define EUSERS 10068 /* not required by POSIX */ | |
76 | # define EDQUOT 10069 | |
77 | # define ESTALE 10070 | |
78 | # define EREMOTE 10071 /* not required by POSIX */ | |
79 | # define GNULIB_defined_ESOCK 1 | |
80 | ||
81 | # endif | |
82 | ||
83 | ||
84 | /* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros | |
85 | EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */ | |
86 | # if @EMULTIHOP_HIDDEN@ | |
87 | # define EMULTIHOP @EMULTIHOP_VALUE@ | |
88 | # define GNULIB_defined_EMULTIHOP 1 | |
89 | # endif | |
90 | # if @ENOLINK_HIDDEN@ | |
91 | # define ENOLINK @ENOLINK_VALUE@ | |
92 | # define GNULIB_defined_ENOLINK 1 | |
93 | # endif | |
94 | # if @EOVERFLOW_HIDDEN@ | |
95 | # define EOVERFLOW @EOVERFLOW_VALUE@ | |
96 | # define GNULIB_defined_EOVERFLOW 1 | |
97 | # endif | |
98 | ||
99 | ||
100 | /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK, | |
101 | EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined. | |
0f00f2c3 | 102 | Likewise, on NonStop Kernel, EDQUOT is not defined. |
c4b681fd LC |
103 | Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151, |
104 | HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133. | |
105 | ||
106 | Note: When one of these systems defines some of these macros some day, | |
107 | binaries will have to be recompiled so that they recognizes the new | |
108 | errno values from the system. */ | |
109 | ||
110 | # ifndef ENOMSG | |
111 | # define ENOMSG 2000 | |
112 | # define GNULIB_defined_ENOMSG 1 | |
113 | # endif | |
114 | ||
115 | # ifndef EIDRM | |
116 | # define EIDRM 2001 | |
117 | # define GNULIB_defined_EIDRM 1 | |
118 | # endif | |
119 | ||
120 | # ifndef ENOLINK | |
121 | # define ENOLINK 2002 | |
122 | # define GNULIB_defined_ENOLINK 1 | |
123 | # endif | |
124 | ||
125 | # ifndef EPROTO | |
126 | # define EPROTO 2003 | |
127 | # define GNULIB_defined_EPROTO 1 | |
128 | # endif | |
129 | ||
130 | # ifndef EMULTIHOP | |
131 | # define EMULTIHOP 2004 | |
132 | # define GNULIB_defined_EMULTIHOP 1 | |
133 | # endif | |
134 | ||
135 | # ifndef EBADMSG | |
136 | # define EBADMSG 2005 | |
137 | # define GNULIB_defined_EBADMSG 1 | |
138 | # endif | |
139 | ||
140 | # ifndef EOVERFLOW | |
141 | # define EOVERFLOW 2006 | |
142 | # define GNULIB_defined_EOVERFLOW 1 | |
143 | # endif | |
144 | ||
145 | # ifndef ENOTSUP | |
146 | # define ENOTSUP 2007 | |
147 | # define GNULIB_defined_ENOTSUP 1 | |
148 | # endif | |
149 | ||
150 | # ifndef ESTALE | |
151 | # define ESTALE 2009 | |
152 | # define GNULIB_defined_ESTALE 1 | |
153 | # endif | |
154 | ||
0f00f2c3 LC |
155 | # ifndef EDQUOT |
156 | # define EDQUOT 2010 | |
157 | # define GNULIB_defined_EDQUOT 1 | |
158 | # endif | |
159 | ||
c4b681fd LC |
160 | # ifndef ECANCELED |
161 | # define ECANCELED 2008 | |
162 | # define GNULIB_defined_ECANCELED 1 | |
163 | # endif | |
164 | ||
165 | ||
3d458a81 AW |
166 | #endif /* _@GUARD_PREFIX@_ERRNO_H */ |
167 | #endif /* _@GUARD_PREFIX@_ERRNO_H */ |