errno.in.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /* A POSIX-like <errno.h>.
  2. Copyright (C) 2008-2009 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software Foundation,
  13. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
  14. #ifndef _GL_ERRNO_H
  15. #if __GNUC__ >= 3
  16. @PRAGMA_SYSTEM_HEADER@
  17. #endif
  18. /* The include_next requires a split double-inclusion guard. */
  19. #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
  20. #ifndef _GL_ERRNO_H
  21. #define _GL_ERRNO_H
  22. /* On native Windows platforms, many macros are not defined. */
  23. # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
  24. /* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */
  25. # define EWOULDBLOCK EAGAIN
  26. /* Values >= 100 seem safe to use. */
  27. # define ETXTBSY 100
  28. # define GNULIB_defined_ETXTBSY 1
  29. /* These are intentionally the same values as the WSA* error numbers, defined
  30. in <winsock2.h>. */
  31. # define EINPROGRESS 10036
  32. # define EALREADY 10037
  33. # define ENOTSOCK 10038
  34. # define EDESTADDRREQ 10039
  35. # define EMSGSIZE 10040
  36. # define EPROTOTYPE 10041
  37. # define ENOPROTOOPT 10042
  38. # define EPROTONOSUPPORT 10043
  39. # define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
  40. # define EOPNOTSUPP 10045
  41. # define EPFNOSUPPORT 10046 /* not required by POSIX */
  42. # define EAFNOSUPPORT 10047
  43. # define EADDRINUSE 10048
  44. # define EADDRNOTAVAIL 10049
  45. # define ENETDOWN 10050
  46. # define ENETUNREACH 10051
  47. # define ENETRESET 10052
  48. # define ECONNABORTED 10053
  49. # define ECONNRESET 10054
  50. # define ENOBUFS 10055
  51. # define EISCONN 10056
  52. # define ENOTCONN 10057
  53. # define ESHUTDOWN 10058 /* not required by POSIX */
  54. # define ETOOMANYREFS 10059 /* not required by POSIX */
  55. # define ETIMEDOUT 10060
  56. # define ECONNREFUSED 10061
  57. # define ELOOP 10062
  58. # define EHOSTDOWN 10064 /* not required by POSIX */
  59. # define EHOSTUNREACH 10065
  60. # define EPROCLIM 10067 /* not required by POSIX */
  61. # define EUSERS 10068 /* not required by POSIX */
  62. # define EDQUOT 10069
  63. # define ESTALE 10070
  64. # define EREMOTE 10071 /* not required by POSIX */
  65. # define GNULIB_defined_ESOCK 1
  66. # endif
  67. /* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
  68. EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
  69. # if @EMULTIHOP_HIDDEN@
  70. # define EMULTIHOP @EMULTIHOP_VALUE@
  71. # define GNULIB_defined_EMULTIHOP 1
  72. # endif
  73. # if @ENOLINK_HIDDEN@
  74. # define ENOLINK @ENOLINK_VALUE@
  75. # define GNULIB_defined_ENOLINK 1
  76. # endif
  77. # if @EOVERFLOW_HIDDEN@
  78. # define EOVERFLOW @EOVERFLOW_VALUE@
  79. # define GNULIB_defined_EOVERFLOW 1
  80. # endif
  81. /* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
  82. EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
  83. Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
  84. HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
  85. Note: When one of these systems defines some of these macros some day,
  86. binaries will have to be recompiled so that they recognizes the new
  87. errno values from the system. */
  88. # ifndef ENOMSG
  89. # define ENOMSG 2000
  90. # define GNULIB_defined_ENOMSG 1
  91. # endif
  92. # ifndef EIDRM
  93. # define EIDRM 2001
  94. # define GNULIB_defined_EIDRM 1
  95. # endif
  96. # ifndef ENOLINK
  97. # define ENOLINK 2002
  98. # define GNULIB_defined_ENOLINK 1
  99. # endif
  100. # ifndef EPROTO
  101. # define EPROTO 2003
  102. # define GNULIB_defined_EPROTO 1
  103. # endif
  104. # ifndef EMULTIHOP
  105. # define EMULTIHOP 2004
  106. # define GNULIB_defined_EMULTIHOP 1
  107. # endif
  108. # ifndef EBADMSG
  109. # define EBADMSG 2005
  110. # define GNULIB_defined_EBADMSG 1
  111. # endif
  112. # ifndef EOVERFLOW
  113. # define EOVERFLOW 2006
  114. # define GNULIB_defined_EOVERFLOW 1
  115. # endif
  116. # ifndef ENOTSUP
  117. # define ENOTSUP 2007
  118. # define GNULIB_defined_ENOTSUP 1
  119. # endif
  120. # ifndef ESTALE
  121. # define ESTALE 2009
  122. # define GNULIB_defined_ESTALE 1
  123. # endif
  124. # ifndef ECANCELED
  125. # define ECANCELED 2008
  126. # define GNULIB_defined_ECANCELED 1
  127. # endif
  128. #endif /* _GL_ERRNO_H */
  129. #endif /* _GL_ERRNO_H */