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