usb_errno.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. /****************************************************************************
  2. * include/errno.h
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. #ifndef __INCLUDE_ERRNO_H
  21. #define __INCLUDE_ERRNO_H
  22. /****************************************************************************
  23. * Included Files
  24. ****************************************************************************/
  25. /****************************************************************************
  26. * Pre-processor Definitions
  27. ****************************************************************************/
  28. /* Convenience/compatibility definition. If the errno is accessed from the
  29. * internal OS code, then the OS code should use the set_errno() and
  30. * get_errno(). Currently, those are just placeholders but would be needed
  31. * in the KERNEL mode build in order to instantiate the process address
  32. * environment as necessary to access the TLS-based errno variable.
  33. */
  34. #define errno *__errno()
  35. #define set_errno(e) \
  36. do \
  37. { \
  38. errno = (int)(e); \
  39. } \
  40. while (0)
  41. #define get_errno() errno
  42. /* Definitions of error numbers and the string that would be
  43. * returned by strerror().
  44. */
  45. #define EPERM 1
  46. #define EPERM_STR "Operation not permitted"
  47. #define ENOENT 2
  48. #define ENOENT_STR "No such file or directory"
  49. #define ESRCH 3
  50. #define ESRCH_STR "No such process"
  51. #define EINTR 4
  52. #define EINTR_STR "Interrupted system call"
  53. #define EIO 5
  54. #define EIO_STR "I/O error"
  55. #define ENXIO 6
  56. #define ENXIO_STR "No such device or address"
  57. #define E2BIG 7
  58. #define E2BIG_STR "Arg list too long"
  59. #define ENOEXEC 8
  60. #define ENOEXEC_STR "Exec format error"
  61. #define EBADF 9
  62. #define EBADF_STR "Bad file number"
  63. #define ECHILD 10
  64. #define ECHILD_STR "No child processes"
  65. #define EAGAIN 11
  66. #define EWOULDBLOCK EAGAIN
  67. #define EAGAIN_STR "Try again"
  68. #define ENOMEM 12
  69. #define ENOMEM_STR "Out of memory"
  70. #define EACCES 13
  71. #define EACCES_STR "Permission denied"
  72. #define EFAULT 14 /* Linux errno extension */
  73. #define EFAULT_STR "Bad address"
  74. #define ENOTBLK 15
  75. #define ENOTBLK_STR "Block device required"
  76. #define EBUSY 16
  77. #define EBUSY_STR "Device or resource busy"
  78. #define EEXIST 17
  79. #define EEXIST_STR "File exists"
  80. #define EXDEV 18
  81. #define EXDEV_STR "Cross-device link"
  82. #define ENODEV 19
  83. #define ENODEV_STR "No such device"
  84. #define ENOTDIR 20
  85. #define ENOTDIR_STR "Not a directory"
  86. #define EISDIR 21
  87. #define EISDIR_STR "Is a directory"
  88. #define EINVAL 22
  89. #define EINVAL_STR "Invalid argument"
  90. #define ENFILE 23
  91. #define ENFILE_STR "File table overflow"
  92. #define EMFILE 24
  93. #define EMFILE_STR "Too many open files"
  94. #define ENOTTY 25
  95. #define ENOTTY_STR "Not a typewriter"
  96. #define ETXTBSY 26
  97. #define ETXTBSY_STR "Text file busy"
  98. #define EFBIG 27
  99. #define EFBIG_STR "File too large"
  100. #define ENOSPC 28
  101. #define ENOSPC_STR "No space left on device"
  102. #define ESPIPE 29
  103. #define ESPIPE_STR "Illegal seek"
  104. #define EROFS 30
  105. #define EROFS_STR "Read-only file system"
  106. #define EMLINK 31
  107. #define EMLINK_STR "Too many links"
  108. #define EPIPE 32
  109. #define EPIPE_STR "Broken pipe"
  110. #define EDOM 33
  111. #define EDOM_STR "Math argument out of domain of func"
  112. #define ERANGE 34
  113. #define ERANGE_STR "Math result not representable"
  114. #define ENOMSG 35
  115. #define ENOMSG_STR "No message of desired type"
  116. #define EIDRM 36
  117. #define EIDRM_STR "Identifier removed"
  118. #define ECHRNG 37 /* Linux errno extension */
  119. #define ECHRNG_STR "Channel number out of range"
  120. #define EL2NSYNC 38 /* Linux errno extension */
  121. #define EL2NSYNC_STR "Level 2 not synchronized"
  122. #define EL3HLT 39 /* Linux errno extension */
  123. #define EL3HLT_STR "Level 3 halted"
  124. #define EL3RST 40 /* Linux errno extension */
  125. #define EL3RST_STR "Level 3 reset"
  126. #define ELNRNG 41 /* Linux errno extension */
  127. #define ELNRNG_STR "Link number out of range"
  128. #define EUNATCH 42 /* Linux errno extension */
  129. #define EUNATCH_STR "Protocol driver not attached"
  130. #define ENOCSI 43 /* Linux errno extension */
  131. #define ENOCSI_STR "No CSI structure available"
  132. #define EL2HLT 44 /* Linux errno extension */
  133. #define EL2HLT_STR "Level 2 halted"
  134. #define EDEADLK 45
  135. #define EDEADLK_STR "Resource deadlock would occur"
  136. #define ENOLCK 46
  137. #define ENOLCK_STR "No record locks available"
  138. #define EBADE 50 /* Linux errno extension */
  139. #define EBADE_STR "Invalid exchange"
  140. #define EBADR 51 /* Linux errno extension */
  141. #define EBADR_STR "Invalid request descriptor"
  142. #define EXFULL 52 /* Linux errno extension */
  143. #define EXFULL_STR "Exchange full"
  144. #define ENOANO 53 /* Linux errno extension */
  145. #define ENOANO_STR "No anode"
  146. #define EBADRQC 54 /* Linux errno extension */
  147. #define EBADRQC_STR "Invalid request code"
  148. #define EBADSLT 55 /* Linux errno extension */
  149. #define EBADSLT_STR "Invalid slot"
  150. #define EDEADLOCK 56 /* Linux errno extension */
  151. #define EDEADLOCK_STR "File locking deadlock error"
  152. #define EBFONT 57 /* Linux errno extension */
  153. #define EBFONT_STR "Bad font file format"
  154. #define ENOSTR 60
  155. #define ENOSTR_STR "Device not a stream"
  156. #define ENODATA 61
  157. #define ENODATA_STR "No data available"
  158. #define ETIME 62
  159. #define ETIME_STR "Timer expired"
  160. #define ENOSR 63
  161. #define ENOSR_STR "Out of streams resources"
  162. #define ENONET 64 /* Linux errno extension */
  163. #define ENONET_STR "Machine is not on the network"
  164. #define ENOPKG 65 /* Linux errno extension */
  165. #define ENOPKG_STR "Package not installed"
  166. #define EREMOTE 66 /* Linux errno extension */
  167. #define EREMOTE_STR "Object is remote"
  168. #define ENOLINK 67
  169. #define ENOLINK_STR "Link has been severed"
  170. #define EADV 68 /* Linux errno extension */
  171. #define EADV_STR "Advertise error"
  172. #define ESRMNT 69 /* Linux errno extension */
  173. #define ESRMNT_STR "Srmount error"
  174. #define ECOMM 70 /* Linux errno extension */
  175. #define ECOMM_STR "Communication error on send"
  176. #define EPROTO 71
  177. #define EPROTO_STR "Protocol error"
  178. #define EMULTIHOP 74
  179. #define EMULTIHOP_STR "Multihop attempted"
  180. #define ELBIN 75 /* Linux errno extension */
  181. #define ELBIN_STR "Inode is remote"
  182. #define EDOTDOT 76 /* Linux errno extension */
  183. #define EDOTDOT_STR "RFS specific error"
  184. #define EBADMSG 77
  185. #define EBADMSG_STR "Not a data message"
  186. #define EFTYPE 79
  187. #define EFTYPE_STR "Inappropriate file type or format"
  188. #define ENOTUNIQ 80 /* Linux errno extension */
  189. #define ENOTUNIQ_STR "Name not unique on network"
  190. #define EBADFD 81 /* Linux errno extension */
  191. #define EBADFD_STR "File descriptor in bad state"
  192. #define EREMCHG 82 /* Linux errno extension */
  193. #define EREMCHG_STR "Remote address changed"
  194. #define ELIBACC 83 /* Linux errno extension */
  195. #define ELIBACC_STR "Can not access a needed shared library"
  196. #define ELIBBAD 84 /* Linux errno extension */
  197. #define ELIBBAD_STR "Accessing a corrupted shared library"
  198. #define ELIBSCN 85 /* Linux errno extension */
  199. #define ELIBSCN_STR ".lib section in a.out corrupted"
  200. #define ELIBMAX 86 /* Linux errno extension */
  201. #define ELIBMAX_STR "Attempting to link in too many shared libraries"
  202. #define ELIBEXEC 87 /* Linux errno extension */
  203. #define ELIBEXEC_STR "Cannot exec a shared library directly"
  204. #define ENOSYS 88
  205. #define ENOSYS_STR "Function not implemented"
  206. #define ENMFILE 89 /* Cygwin */
  207. #define ENMFILE_STR "No more files"
  208. #define ENOTEMPTY 90
  209. #define ENOTEMPTY_STR "Directory not empty"
  210. #define ENAMETOOLONG 91
  211. #define ENAMETOOLONG_STR "File name too long"
  212. #define ELOOP 92
  213. #define ELOOP_STR "Too many symbolic links encountered"
  214. #define EOPNOTSUPP 95
  215. #define EOPNOTSUPP_STR "Operation not supported on transport endpoint"
  216. #define EPFNOSUPPORT 96
  217. #define EPFNOSUPPORT_STR "Protocol family not supported"
  218. #define ECONNRESET 104
  219. #define ECONNRESET_STR "Connection reset by peer"
  220. #define ENOBUFS 105
  221. #define ENOBUFS_STR "No buffer space available"
  222. #define EAFNOSUPPORT 106
  223. #define EAFNOSUPPORT_STR "Address family not supported by protocol"
  224. #define EPROTOTYPE 107
  225. #define EPROTOTYPE_STR "Protocol wrong type for socket"
  226. #define ENOTSOCK 108
  227. #define ENOTSOCK_STR "Socket operation on non-socket"
  228. #define ENOPROTOOPT 109
  229. #define ENOPROTOOPT_STR "Protocol not available"
  230. #define ESHUTDOWN 110 /* Linux errno extension */
  231. #define ESHUTDOWN_STR "Cannot send after transport endpoint shutdown"
  232. #define ECONNREFUSED 111
  233. #define ECONNREFUSED_STR "Connection refused"
  234. #define EADDRINUSE 112
  235. #define EADDRINUSE_STR "Address already in use"
  236. #define ECONNABORTED 113
  237. #define ECONNABORTED_STR "Software caused connection abort"
  238. #define ENETUNREACH 114
  239. #define ENETUNREACH_STR "Network is unreachable"
  240. #define ENETDOWN 115
  241. #define ENETDOWN_STR "Network is down"
  242. #define ETIMEDOUT 116
  243. #define ETIMEDOUT_STR "Connection timed out"
  244. #define EHOSTDOWN 117
  245. #define EHOSTDOWN_STR "Host is down"
  246. #define EHOSTUNREACH 118
  247. #define EHOSTUNREACH_STR "No route to host"
  248. #define EINPROGRESS 119
  249. #define EINPROGRESS_STR "Operation now in progress"
  250. #define EALREADY 120
  251. #define EALREADY_STR "Socket already connected"
  252. #define EDESTADDRREQ 121
  253. #define EDESTADDRREQ_STR "Destination address required"
  254. #define EMSGSIZE 122
  255. #define EMSGSIZE_STR "Message too long"
  256. #define EPROTONOSUPPORT 123
  257. #define EPROTONOSUPPORT_STR "Protocol not supported"
  258. #define ESOCKTNOSUPPORT 124 /* Linux errno extension */
  259. #define ESOCKTNOSUPPORT_STR "Socket type not supported"
  260. #define EADDRNOTAVAIL 125
  261. #define EADDRNOTAVAIL_STR "Cannot assign requested address"
  262. #define ENETRESET 126
  263. #define ENETRESET_STR "Network dropped connection because of reset"
  264. #define EISCONN 127
  265. #define EISCONN_STR "Transport endpoint is already connected"
  266. #define ENOTCONN 128
  267. #define ENOTCONN_STR "Transport endpoint is not connected"
  268. #define ETOOMANYREFS 129
  269. #define ETOOMANYREFS_STR "Too many references: cannot splice"
  270. #define EPROCLIM 130
  271. #define EPROCLIM_STR "Limit would be exceeded by attempted fork"
  272. #define EUSERS 131
  273. #define EUSERS_STR "Too many users"
  274. #define EDQUOT 132
  275. #define EDQUOT_STR "Quota exceeded"
  276. #define ESTALE 133
  277. #define ESTALE_STR "Stale NFS file handle"
  278. #define ENOTSUP 134
  279. #define ENOTSUP_STR "Not supported"
  280. #define ENOMEDIUM 135 /* Linux errno extension */
  281. #define ENOMEDIUM_STR "No medium found"
  282. #define ENOSHARE 136 /* Cygwin */
  283. #define ENOSHARE_STR "No such host or network path"
  284. #define ECASECLASH 137 /* Cygwin */
  285. #define ECASECLASH_STR "Filename exists with different case"
  286. #define EILSEQ 138
  287. #define EILSEQ_STR "Illegal byte sequence"
  288. #define EOVERFLOW 139
  289. #define EOVERFLOW_STR "Value too large for defined data type"
  290. #define ECANCELED 140
  291. #define ECANCELED_STR "Operation cancelled"
  292. #define ENOTRECOVERABLE 141
  293. #define ENOTRECOVERABLE_STR "State not recoverable"
  294. #define EOWNERDEAD 142
  295. #define EOWNERDEAD_STR "Previous owner died"
  296. #define ESTRPIPE 143 /* Linux errno extension */
  297. #define ESTRPIPE_STR "Streams pipe error"
  298. #define __ELASTERROR 2000 /* Users can add values starting here */
  299. /****************************************************************************
  300. * Public Type Definitions
  301. ****************************************************************************/
  302. /****************************************************************************
  303. * Public Function Prototypes
  304. ****************************************************************************/
  305. #undef EXTERN
  306. #if defined(__cplusplus)
  307. #define EXTERN extern "C"
  308. extern "C"
  309. {
  310. #else
  311. #define EXTERN extern
  312. #endif
  313. /* Return a pointer to the thread specific errno. */
  314. int *__errno(void);
  315. #undef EXTERN
  316. #if defined(__cplusplus)
  317. }
  318. #endif
  319. #endif /* __INCLUDE_ERRNO_H */