Add support for user-level 9P servers/clients and various bug fixes to go with them.

This commit is contained in:
rsc 2003-12-11 17:48:38 +00:00
parent ac244f8d28
commit 32f69c36e0
60 changed files with 965 additions and 485 deletions

View file

@ -59,18 +59,13 @@ void
main(int argc, char **argv)
{
int i, cmd, kflag;
char *line, *p, *root;
char *line, *p;
Binit(&binbuf, 0, OREAD);
Binit(&boutbuf, 1, OWRITE);
kflag = 0;
line = 0;
dict = 0;
root = getenv("PLAN9");
if(root == nil)
root = "/usr/local/plan9";
if(chdir(root) < 0)
sysfatal("chdir %s: %r", root);
for(i=0; dicts[i].name; i++){
if(access(dicts[i].path, 0)>=0 && access(dicts[i].indexpath, 0)>=0){
@ -126,12 +121,12 @@ main(int argc, char **argv)
}
bdict = Bopen(dict->path, OREAD);
if(!bdict) {
err("can't open dictionary %s/%s", root, dict->path);
err("can't open dictionary %s", dict->path);
exits("nodict");
}
bindex = Bopen(dict->indexpath, OREAD);
if(!bindex) {
err("can't open index %s/%s", root, dict->indexpath);
err("can't open index %s", dict->indexpath);
exits("noindex");
}
indextop = Bseek(bindex, 0L, 2);