error.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. struct errormap {
  33. char *name;
  34. int val;
  35. struct hlist_node list;
  36. };
  37. #define ERRHASHSZ 32
  38. static struct hlist_head hash_errmap[ERRHASHSZ];
  39. /* FixMe - reduce to a reasonable size */
  40. static struct errormap errmap[] = {
  41. {"Operation not permitted", 1},
  42. {"wstat prohibited", 1},
  43. {"No such file or directory", 2},
  44. {"file not found", 2},
  45. {"Interrupted system call", 4},
  46. {"Input/output error", 5},
  47. {"No such device or address", 6},
  48. {"Argument list too long", 7},
  49. {"Bad file descriptor", 9},
  50. {"Resource temporarily unavailable", 11},
  51. {"Cannot allocate memory", 12},
  52. {"Permission denied", 13},
  53. {"Bad address", 14},
  54. {"Block device required", 15},
  55. {"Device or resource busy", 16},
  56. {"File exists", 17},
  57. {"Invalid cross-device link", 18},
  58. {"No such device", 19},
  59. {"Not a directory", 20},
  60. {"Is a directory", 21},
  61. {"Invalid argument", 22},
  62. {"Too many open files in system", 23},
  63. {"Too many open files", 24},
  64. {"Text file busy", 26},
  65. {"File too large", 27},
  66. {"No space left on device", 28},
  67. {"Illegal seek", 29},
  68. {"Read-only file system", 30},
  69. {"Too many links", 31},
  70. {"Broken pipe", 32},
  71. {"Numerical argument out of domain", 33},
  72. {"Numerical result out of range", 34},
  73. {"Resource deadlock avoided", 35},
  74. {"File name too long", 36},
  75. {"No locks available", 37},
  76. {"Function not implemented", 38},
  77. {"Directory not empty", 39},
  78. {"Too many levels of symbolic links", 40},
  79. {"Unknown error 41", 41},
  80. {"No message of desired type", 42},
  81. {"Identifier removed", 43},
  82. {"File locking deadlock error", 58},
  83. {"No data available", 61},
  84. {"Machine is not on the network", 64},
  85. {"Package not installed", 65},
  86. {"Object is remote", 66},
  87. {"Link has been severed", 67},
  88. {"Communication error on send", 70},
  89. {"Protocol error", 71},
  90. {"Bad message", 74},
  91. {"File descriptor in bad state", 77},
  92. {"Streams pipe error", 86},
  93. {"Too many users", 87},
  94. {"Socket operation on non-socket", 88},
  95. {"Message too long", 90},
  96. {"Protocol not available", 92},
  97. {"Protocol not supported", 93},
  98. {"Socket type not supported", 94},
  99. {"Operation not supported", 95},
  100. {"Protocol family not supported", 96},
  101. {"Network is down", 100},
  102. {"Network is unreachable", 101},
  103. {"Network dropped connection on reset", 102},
  104. {"Software caused connection abort", 103},
  105. {"Connection reset by peer", 104},
  106. {"No buffer space available", 105},
  107. {"Transport endpoint is already connected", 106},
  108. {"Transport endpoint is not connected", 107},
  109. {"Cannot send after transport endpoint shutdown", 108},
  110. {"Connection timed out", 110},
  111. {"Connection refused", 111},
  112. {"Host is down", 112},
  113. {"No route to host", 113},
  114. {"Operation already in progress", 114},
  115. {"Operation now in progress", 115},
  116. {"Is a named type file", 120},
  117. {"Remote I/O error", 121},
  118. {"Disk quota exceeded", 122},
  119. {"Operation canceled", 125},
  120. {"Unknown error 126", 126},
  121. {"Unknown error 127", 127},
  122. /* errors from fossil, vacfs, and u9fs */
  123. {"fid unknown or out of range", EBADF},
  124. {"permission denied", EACCES},
  125. {"file does not exist", ENOENT},
  126. {"authentication failed", ECONNREFUSED},
  127. {"bad offset in directory read", ESPIPE},
  128. {"bad use of fid", EBADF},
  129. {"wstat can't convert between files and directories", EPERM},
  130. {"directory is not empty", ENOTEMPTY},
  131. {"file exists", EEXIST},
  132. {"file already exists", EEXIST},
  133. {"file or directory already exists", EEXIST},
  134. {"fid already in use", EBADF},
  135. {"file in use", ETXTBSY},
  136. {"i/o error", EIO},
  137. {"file already open for I/O", ETXTBSY},
  138. {"illegal mode", EINVAL},
  139. {"illegal name", ENAMETOOLONG},
  140. {"not a directory", ENOTDIR},
  141. {"not a member of proposed group", EINVAL},
  142. {"not owner", EACCES},
  143. {"only owner can change group in wstat", EACCES},
  144. {"read only file system", EROFS},
  145. {"no access to special file", EPERM},
  146. {"i/o count too large", EIO},
  147. {"unknown group", EINVAL},
  148. {"unknown user", EINVAL},
  149. {"bogus wstat buffer", EPROTO},
  150. {"exclusive use file already open", EAGAIN},
  151. {"corrupted directory entry", EIO},
  152. {"corrupted file entry", EIO},
  153. {"corrupted block label", EIO},
  154. {"corrupted meta data", EIO},
  155. {"illegal offset", EINVAL},
  156. {"illegal path element", ENOENT},
  157. {"root of file system is corrupted", EIO},
  158. {"corrupted super block", EIO},
  159. {"protocol botch", EPROTO},
  160. {"file system is full", ENOSPC},
  161. {"file is in use", EAGAIN},
  162. {"directory entry is not allocated", ENOENT},
  163. {"file is read only", EROFS},
  164. {"file has been removed", EIDRM},
  165. {"only support truncation to zero length", EPERM},
  166. {"cannot remove root", EPERM},
  167. {"file too big", EFBIG},
  168. {"venti i/o error", EIO},
  169. /* these are not errors */
  170. {"u9fs rhostsauth: no authentication required", 0},
  171. {"u9fs authnone: no authentication required", 0},
  172. {NULL, -1}
  173. };
  174. extern int v9fs_error_init(void);
  175. extern int v9fs_errstr2errno(char *errstr);