dat.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #include "all.h"
  10. Uid* uid;
  11. char* uidspace;
  12. int16_t* gidspace;
  13. RWLock mainlock;
  14. int32_t boottime;
  15. Tlock *tlocks;
  16. Conf conf;
  17. Cons cons;
  18. Chan *chan;
  19. char service[2*NAMELEN];
  20. char *progname;
  21. char *procname;
  22. int RBUFSIZE;
  23. int BUFSIZE;
  24. int DIRPERBUF;
  25. int INDPERBUF;
  26. int INDPERBUF2;
  27. int FEPERBUF;
  28. Filsys filesys[MAXFILSYS] =
  29. {
  30. {"main", {Devwren, 0, 0, 0}, 0},
  31. };
  32. Device devnone = {Devnone, 0, 0, 0};
  33. Devcall devcall[MAXDEV] = {
  34. [Devnone] {0},
  35. [Devwren] {wreninit, wrenream, wrencheck, wrensuper, wrenroot, wrensize, wrenread, wrenwrite},
  36. };
  37. char* tagnames[] =
  38. {
  39. [Tbuck] "Tbuck",
  40. [Tdir] "Tdir",
  41. [Tfile] "Tfile",
  42. [Tfree] "Tfree",
  43. [Tind1] "Tind1",
  44. [Tind2] "Tind2",
  45. [Tnone] "Tnone",
  46. [Tsuper] "Tsuper",
  47. [Tvirgo] "Tvirgo",
  48. [Tcache] "Tcache",
  49. };
  50. char *errstring[MAXERR] =
  51. {
  52. [Ebadspc] "attach -- bad specifier",
  53. [Efid] "unknown fid",
  54. [Echar] "bad character in directory name",
  55. [Eopen] "read/write -- on non open fid",
  56. [Ecount] "read/write -- count too big",
  57. [Ealloc] "phase error -- directory entry not allocated",
  58. [Eqid] "phase error -- qid does not match",
  59. [Eauth] "authentication failed",
  60. [Eauthmsg] "kfs: authentication not required",
  61. [Eaccess] "access permission denied",
  62. [Eentry] "directory entry not found",
  63. [Emode] "open/create -- unknown mode",
  64. [Edir1] "walk -- in a non-directory",
  65. [Edir2] "create -- in a non-directory",
  66. [Ephase] "phase error -- cannot happen",
  67. [Eexist] "create -- file exists",
  68. [Edot] "create -- . and .. illegal names",
  69. [Eempty] "remove -- directory not empty",
  70. [Ebadu] "attach -- privileged user",
  71. [Enotu] "wstat -- not owner",
  72. [Enotg] "wstat -- not in group",
  73. [Enotl] "wstat -- attempt to change length",
  74. [Enotd] "wstat -- attempt to change directory",
  75. [Enotm] "wstat -- unknown type/mode",
  76. [Ename] "create/wstat -- bad character in file name",
  77. [Ewalk] "walk -- too many (system wide)",
  78. [Eronly] "file system read only",
  79. [Efull] "file system full",
  80. [Eoffset] "read/write -- offset negative",
  81. [Elocked] "open/create -- file is locked",
  82. [Ebroken] "close/read/write -- lock is broken",
  83. [Efidinuse] "fid already in use",
  84. [Etoolong] "name too long",
  85. [Ersc] "it's russ's fault. bug him.",
  86. [Econvert] "protocol botch",
  87. [Eqidmode] "wstat -- qid.type/dir.mode mismatch",
  88. [Esystem] "kfs system error",
  89. };