error.h 6.0 KB

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