error.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. * linux/fs/9p/error.h
  3. *
  4. * Huge Nasty Error Table
  5. *
  6. * Plan 9 uses error strings, Unix uses error numbers. This table tries to
  7. * match UNIX strings and Plan 9 strings to unix error numbers. It is used
  8. * to preload the dynamic error table which can also track user-specific error
  9. * strings.
  10. *
  11. * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
  12. * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to:
  26. * Free Software Foundation
  27. * 51 Franklin Street, Fifth Floor
  28. * Boston, MA 02111-1301 USA
  29. *
  30. */
  31. #include <linux/errno.h>
  32. #include <asm/errno.h>
  33. struct errormap {
  34. char *name;
  35. int val;
  36. int namelen;
  37. struct hlist_node list;
  38. };
  39. #define ERRHASHSZ 32
  40. static struct hlist_head hash_errmap[ERRHASHSZ];
  41. /* FixMe - reduce to a reasonable size */
  42. static struct errormap errmap[] = {
  43. {"Operation not permitted", EPERM},
  44. {"wstat prohibited", EPERM},
  45. {"No such file or directory", ENOENT},
  46. {"directory entry not found", ENOENT},
  47. {"file not found", ENOENT},
  48. {"Interrupted system call", EINTR},
  49. {"Input/output error", EIO},
  50. {"No such device or address", ENXIO},
  51. {"Argument list too long", E2BIG},
  52. {"Bad file descriptor", EBADF},
  53. {"Resource temporarily unavailable", EAGAIN},
  54. {"Cannot allocate memory", ENOMEM},
  55. {"Permission denied", EACCES},
  56. {"Bad address", EFAULT},
  57. {"Block device required", ENOTBLK},
  58. {"Device or resource busy", EBUSY},
  59. {"File exists", EEXIST},
  60. {"Invalid cross-device link", EXDEV},
  61. {"No such device", ENODEV},
  62. {"Not a directory", ENOTDIR},
  63. {"Is a directory", EISDIR},
  64. {"Invalid argument", EINVAL},
  65. {"Too many open files in system", ENFILE},
  66. {"Too many open files", EMFILE},
  67. {"Text file busy", ETXTBSY},
  68. {"File too large", EFBIG},
  69. {"No space left on device", ENOSPC},
  70. {"Illegal seek", ESPIPE},
  71. {"Read-only file system", EROFS},
  72. {"Too many links", EMLINK},
  73. {"Broken pipe", EPIPE},
  74. {"Numerical argument out of domain", EDOM},
  75. {"Numerical result out of range", ERANGE},
  76. {"Resource deadlock avoided", EDEADLK},
  77. {"File name too long", ENAMETOOLONG},
  78. {"No locks available", ENOLCK},
  79. {"Function not implemented", ENOSYS},
  80. {"Directory not empty", ENOTEMPTY},
  81. {"Too many levels of symbolic links", ELOOP},
  82. {"No message of desired type", ENOMSG},
  83. {"Identifier removed", EIDRM},
  84. {"No data available", ENODATA},
  85. {"Machine is not on the network", ENONET},
  86. {"Package not installed", ENOPKG},
  87. {"Object is remote", EREMOTE},
  88. {"Link has been severed", ENOLINK},
  89. {"Communication error on send", ECOMM},
  90. {"Protocol error", EPROTO},
  91. {"Bad message", EBADMSG},
  92. {"File descriptor in bad state", EBADFD},
  93. {"Streams pipe error", ESTRPIPE},
  94. {"Too many users", EUSERS},
  95. {"Socket operation on non-socket", ENOTSOCK},
  96. {"Message too long", EMSGSIZE},
  97. {"Protocol not available", ENOPROTOOPT},
  98. {"Protocol not supported", EPROTONOSUPPORT},
  99. {"Socket type not supported", ESOCKTNOSUPPORT},
  100. {"Operation not supported", EOPNOTSUPP},
  101. {"Protocol family not supported", EPFNOSUPPORT},
  102. {"Network is down", ENETDOWN},
  103. {"Network is unreachable", ENETUNREACH},
  104. {"Network dropped connection on reset", ENETRESET},
  105. {"Software caused connection abort", ECONNABORTED},
  106. {"Connection reset by peer", ECONNRESET},
  107. {"No buffer space available", ENOBUFS},
  108. {"Transport endpoint is already connected", EISCONN},
  109. {"Transport endpoint is not connected", ENOTCONN},
  110. {"Cannot send after transport endpoint shutdown", ESHUTDOWN},
  111. {"Connection timed out", ETIMEDOUT},
  112. {"Connection refused", ECONNREFUSED},
  113. {"Host is down", EHOSTDOWN},
  114. {"No route to host", EHOSTUNREACH},
  115. {"Operation already in progress", EALREADY},
  116. {"Operation now in progress", EINPROGRESS},
  117. {"Is a named type file", EISNAM},
  118. {"Remote I/O error", EREMOTEIO},
  119. {"Disk quota exceeded", EDQUOT},
  120. /* errors from fossil, vacfs, and u9fs */
  121. {"fid unknown or out of range", EBADF},
  122. {"permission denied", EACCES},
  123. {"file does not exist", ENOENT},
  124. {"authentication failed", ECONNREFUSED},
  125. {"bad offset in directory read", ESPIPE},
  126. {"bad use of fid", EBADF},
  127. {"wstat can't convert between files and directories", EPERM},
  128. {"directory is not empty", ENOTEMPTY},
  129. {"file exists", EEXIST},
  130. {"file already exists", EEXIST},
  131. {"file or directory already exists", EEXIST},
  132. {"fid already in use", EBADF},
  133. {"file in use", ETXTBSY},
  134. {"i/o error", EIO},
  135. {"file already open for I/O", ETXTBSY},
  136. {"illegal mode", EINVAL},
  137. {"illegal name", ENAMETOOLONG},
  138. {"not a directory", ENOTDIR},
  139. {"not a member of proposed group", EPERM},
  140. {"not owner", EACCES},
  141. {"only owner can change group in wstat", EACCES},
  142. {"read only file system", EROFS},
  143. {"no access to special file", EPERM},
  144. {"i/o count too large", EIO},
  145. {"unknown group", EINVAL},
  146. {"unknown user", EINVAL},
  147. {"bogus wstat buffer", EPROTO},
  148. {"exclusive use file already open", EAGAIN},
  149. {"corrupted directory entry", EIO},
  150. {"corrupted file entry", EIO},
  151. {"corrupted block label", EIO},
  152. {"corrupted meta data", EIO},
  153. {"illegal offset", EINVAL},
  154. {"illegal path element", ENOENT},
  155. {"root of file system is corrupted", EIO},
  156. {"corrupted super block", EIO},
  157. {"protocol botch", EPROTO},
  158. {"file system is full", ENOSPC},
  159. {"file is in use", EAGAIN},
  160. {"directory entry is not allocated", ENOENT},
  161. {"file is read only", EROFS},
  162. {"file has been removed", EIDRM},
  163. {"only support truncation to zero length", EPERM},
  164. {"cannot remove root", EPERM},
  165. {"file too big", EFBIG},
  166. {"venti i/o error", EIO},
  167. /* these are not errors */
  168. {"u9fs rhostsauth: no authentication required", 0},
  169. {"u9fs authnone: no authentication required", 0},
  170. {NULL, -1}
  171. };
  172. extern int v9fs_error_init(void);