libc_errno.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * File : libc_errno.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2017, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2016-11-12 Bernard The first version
  23. */
  24. #ifndef LIBC_ERRNO_H__
  25. #define LIBC_ERRNO_H__
  26. #include <rtconfig.h>
  27. #if defined(RT_USING_NEWLIB) || defined(_WIN32)
  28. /* use errno.h file in newlib */
  29. #include <errno.h>
  30. #else
  31. /* define errno self. */
  32. #define EPERM 1
  33. #define ENOENT 2
  34. #define ESRCH 3
  35. #define EINTR 4
  36. #define EIO 5
  37. #define ENXIO 6
  38. #define E2BIG 7
  39. #define ENOEXEC 8
  40. #define EBADF 9
  41. #define ECHILD 10
  42. #define EAGAIN 11
  43. #define ENOMEM 12
  44. #define EACCES 13
  45. #define EFAULT 14
  46. #define ENOTBLK 15
  47. #define EBUSY 16
  48. #define EEXIST 17
  49. #define EXDEV 18
  50. #define ENODEV 19
  51. #define ENOTDIR 20
  52. #define EISDIR 21
  53. #define EINVAL 22
  54. #define ENFILE 23
  55. #define EMFILE 24
  56. #define ENOTTY 25
  57. #define ETXTBSY 26
  58. #define EFBIG 27
  59. #define ENOSPC 28
  60. #define ESPIPE 29
  61. #define EROFS 30
  62. #define EMLINK 31
  63. #define EPIPE 32
  64. #define EDOM 33
  65. #define ERANGE 34
  66. #define EDEADLK 35
  67. #define ENAMETOOLONG 36
  68. #define ENOLCK 37
  69. #define ENOSYS 38
  70. #define ENOTEMPTY 39
  71. #define ELOOP 40
  72. #define EWOULDBLOCK EAGAIN
  73. #define ENOMSG 42
  74. #define EIDRM 43
  75. #define ECHRNG 44
  76. #define EL2NSYNC 45
  77. #define EL3HLT 46
  78. #define EL3RST 47
  79. #define ELNRNG 48
  80. #define EUNATCH 49
  81. #define ENOCSI 50
  82. #define EL2HLT 51
  83. #define EBADE 52
  84. #define EBADR 53
  85. #define EXFULL 54
  86. #define ENOANO 55
  87. #define EBADRQC 56
  88. #define EBADSLT 57
  89. #define EDEADLOCK EDEADLK
  90. #define EBFONT 59
  91. #define ENOSTR 60
  92. #define ENODATA 61
  93. #define ETIME 62
  94. #define ENOSR 63
  95. #define ENONET 64
  96. #define ENOPKG 65
  97. #define EREMOTE 66
  98. #define ENOLINK 67
  99. #define EADV 68
  100. #define ESRMNT 69
  101. #define ECOMM 70
  102. #define EPROTO 71
  103. #define EMULTIHOP 72
  104. #define EDOTDOT 73
  105. #define EBADMSG 74
  106. #define EOVERFLOW 75
  107. #define ENOTUNIQ 76
  108. #define EBADFD 77
  109. #define EREMCHG 78
  110. #define ELIBACC 79
  111. #define ELIBBAD 80
  112. #define ELIBSCN 81
  113. #define ELIBMAX 82
  114. #define ELIBEXEC 83
  115. #define EILSEQ 84
  116. #define ERESTART 85
  117. #define ESTRPIPE 86
  118. #define EUSERS 87
  119. #define ENOTSOCK 88
  120. #define EDESTADDRREQ 89
  121. #define EMSGSIZE 90
  122. #define EPROTOTYPE 91
  123. #define ENOPROTOOPT 92
  124. #define EPROTONOSUPPORT 93
  125. #define ESOCKTNOSUPPORT 94
  126. #define EOPNOTSUPP 95
  127. #define ENOTSUP EOPNOTSUPP
  128. #define EPFNOSUPPORT 96
  129. #define EAFNOSUPPORT 97
  130. #define EADDRINUSE 98
  131. #define EADDRNOTAVAIL 99
  132. #define ENETDOWN 100
  133. #define ENETUNREACH 101
  134. #define ENETRESET 102
  135. #define ECONNABORTED 103
  136. #define ECONNRESET 104
  137. #define ENOBUFS 105
  138. #define EISCONN 106
  139. #define ENOTCONN 107
  140. #define ESHUTDOWN 108
  141. #define ETOOMANYREFS 109
  142. #define ETIMEDOUT 110
  143. #define ECONNREFUSED 111
  144. #define EHOSTDOWN 112
  145. #define EHOSTUNREACH 113
  146. #define EALREADY 114
  147. #define EINPROGRESS 115
  148. #define ESTALE 116
  149. #define EUCLEAN 117
  150. #define ENOTNAM 118
  151. #define ENAVAIL 119
  152. #define EISNAM 120
  153. #define EREMOTEIO 121
  154. #define EDQUOT 122
  155. #define ENOMEDIUM 123
  156. #define EMEDIUMTYPE 124
  157. #define ECANCELED 125
  158. #define ENOKEY 126
  159. #define EKEYEXPIRED 127
  160. #define EKEYREVOKED 128
  161. #define EKEYREJECTED 129
  162. #define EOWNERDEAD 130
  163. #define ENOTRECOVERABLE 131
  164. #define ERFKILL 132
  165. #define EHWPOISON 133
  166. #endif
  167. #endif