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