Browse Source

Plan 9 from Bell Labs 2005-01-23

David du Colombier 17 years ago
parent
commit
8ac7d966ae

+ 18 - 5
dist/replica/_plan9.db

@@ -3126,7 +3126,7 @@ rc/bin/ups - 775 sys sys 1091021981 806
 rc/bin/uptime - 775 sys sys 1074730712 234
 rc/bin/usbstart - 775 sys sys 1044894155 81
 rc/bin/usps - 775 sys sys 1016826030 450
-rc/bin/vwhois - 775 sys sys 1097960228 298
+rc/bin/vwhois - 775 sys sys 1106409971 445
 rc/bin/wdoc2txt - 755 sys sys 1017431153 277
 rc/bin/weather - 775 sys sys 1016825765 795
 rc/bin/who - 775 sys sys 945617210 61
@@ -7072,7 +7072,7 @@ sys/src/cmd/aux/mnihongo/mnihongo.c - 664 sys sys 946759402 6406
 sys/src/cmd/aux/mnihongo/tmac.nihongo - 664 sys sys 944960789 22
 sys/src/cmd/aux/mouse.c - 664 sys sys 1063855425 7049
 sys/src/cmd/aux/ms2.c - 664 sys sys 1015008685 3129
-sys/src/cmd/aux/msexceltables.c - 664 sys sys 1105123098 13134
+sys/src/cmd/aux/msexceltables.c - 664 sys sys 1106410108 13282
 sys/src/cmd/aux/mswordstrings.c - 664 sys sys 952201344 5767
 sys/src/cmd/aux/na - 20000000775 sys sys 955036627 0
 sys/src/cmd/aux/na/mkfile - 664 sys sys 955036627 121
@@ -7522,7 +7522,7 @@ sys/src/cmd/faces - 20000000775 sys sys 952888246 0
 sys/src/cmd/faces/dblook.c - 664 sys sys 944961084 359
 sys/src/cmd/faces/facedb.c - 664 sys sys 1062460263 9927
 sys/src/cmd/faces/faces.h - 664 sys sys 1072972232 1115
-sys/src/cmd/faces/main.c - 664 sys sys 1072972232 13637
+sys/src/cmd/faces/main.c - 664 sys sys 1106409986 13643
 sys/src/cmd/faces/mkfile - 664 sys sys 1062460262 355
 sys/src/cmd/faces/plumb.c - 664 sys sys 1072972233 7054
 sys/src/cmd/faces/util.c - 664 sys sys 1035698250 569
@@ -9747,7 +9747,7 @@ sys/src/cmd/mkmany - 664 sys sys 1022112160 1196
 sys/src/cmd/mkone - 664 sys sys 1101311048 835
 sys/src/cmd/mkstate.c - 664 sys sys 1014926695 2995
 sys/src/cmd/mksyslib - 664 sys sys 1022112160 660
-sys/src/cmd/mntgen.c - 664 sys sys 1048644521 3365
+sys/src/cmd/mntgen.c - 664 sys sys 1106410349 3630
 sys/src/cmd/mount.c - 664 sys sys 1034195354 1508
 sys/src/cmd/ms2html.c - 664 sys sys 1084470689 40502
 sys/src/cmd/mtime.c - 664 sys sys 1036172302 450
@@ -12062,7 +12062,7 @@ sys/src/libmach/qdb.c - 664 sys sys 1014929544 27188
 sys/src/libmach/qobj.c - 664 sys sys 1091732625 2310
 sys/src/libmach/setmach.c - 664 sys sys 1089313993 2682
 sys/src/libmach/swap.c - 664 sys sys 964540518 1026
-sys/src/libmach/sym.c - 664 sys sys 1088653081 26582
+sys/src/libmach/sym.c - 664 sys sys 1106409575 26581
 sys/src/libmach/v.c - 664 sys sys 964540518 3403
 sys/src/libmach/vcodas.c - 664 sys sys 1014929545 10253
 sys/src/libmach/vdb.c - 664 sys sys 1014929545 22248
@@ -12457,3 +12457,16 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/acid - 775 sys sys 1106453224 355754
+386/bin/db - 775 sys sys 1106453226 302164
+386/bin/faces - 775 sys sys 1106453226 192585
+386/bin/snap - 775 sys sys 1106453229 269608
+386/bin/snapfs - 775 sys sys 1106453230 338462
+386/bin/kprof - 775 sys sys 1106453227 99494
+386/bin/ktrace - 775 sys sys 1106453227 113445
+386/bin/nm - 775 sys sys 1106453228 115508
+386/bin/prof - 775 sys sys 1106453228 104237
+386/bin/aux/msexceltables - 775 sys sys 1106453225 80995
+386/bin/mntgen - 775 sys sys 1106453227 139193
+386/bin/tprof - 775 sys sys 1106453230 255090
+386/lib/libmach.a - 664 sys sys 1106453232 652292

+ 18 - 18
dist/replica/plan9.db

@@ -19,7 +19,7 @@
 386/bin/8l - 775 sys sys 1104121955 114930
 386/bin/9660srv - 775 sys sys 1104121955 103973
 386/bin/aan - 775 sys sys 1104121955 130710
-386/bin/acid - 775 sys sys 1104121956 355756
+386/bin/acid - 775 sys sys 1106453224 355754
 386/bin/acme - 775 sys sys 1104898008 427257
 386/bin/ape - 20000000775 sys sys 1016944144 0
 386/bin/ape/basename - 775 sys sys 1087442501 132681
@@ -116,7 +116,7 @@
 386/bin/aux/mnihongo - 775 sys sys 1104121979 138518
 386/bin/aux/mouse - 775 sys sys 1104121979 44026
 386/bin/aux/ms2 - 775 sys sys 1104121980 81824
-386/bin/aux/msexceltables - 775 sys sys 1105070896 80904
+386/bin/aux/msexceltables - 775 sys sys 1106453225 80995
 386/bin/aux/mswordstrings - 775 sys sys 1104121980 65317
 386/bin/aux/na - 775 sys sys 1104121980 154635
 386/bin/aux/nfsmount - 775 sys sys 1104121981 234092
@@ -185,7 +185,7 @@
 386/bin/cpu - 775 sys sys 1104121997 137694
 386/bin/crop - 775 sys sys 1104121998 115763
 386/bin/date - 775 sys sys 1104121998 43261
-386/bin/db - 775 sys sys 1104121999 302166
+386/bin/db - 775 sys sys 1106453226 302164
 386/bin/dc - 775 sys sys 1104121999 99028
 386/bin/dd - 775 sys sys 1104121999 45347
 386/bin/deroff - 775 sys sys 1104122000 74244
@@ -219,7 +219,7 @@
 386/bin/execnet - 775 sys sys 1104122007 171896
 386/bin/exportfs - 775 sys sys 1104122007 161148
 386/bin/ext2srv - 775 sys sys 1104122007 173894
-386/bin/faces - 775 sys sys 1104122008 192577
+386/bin/faces - 775 sys sys 1106453226 192585
 386/bin/factor - 775 sys sys 1104122008 61475
 386/bin/file - 775 sys sys 1104898008 112418
 386/bin/fmt - 775 sys sys 1104122009 65301
@@ -303,8 +303,8 @@
 386/bin/join - 775 sys sys 1104122031 116241
 386/bin/jpg - 775 sys sys 1104122031 174137
 386/bin/kbmap - 775 sys sys 1104122032 142504
-386/bin/kprof - 775 sys sys 1104122032 99496
-386/bin/ktrace - 775 sys sys 1104122032 113447
+386/bin/kprof - 775 sys sys 1106453227 99494
+386/bin/ktrace - 775 sys sys 1106453227 113445
 386/bin/lens - 775 sys sys 1104122032 124095
 386/bin/lex - 775 sys sys 1104122033 98664
 386/bin/lnfs - 775 sys sys 1104122033 99449
@@ -316,7 +316,7 @@
 386/bin/mkdir - 775 sys sys 1104122035 60964
 386/bin/mkpaqfs - 775 sys sys 1104122035 94509
 386/bin/mkstate - 775 sys sys 1104122035 63519
-386/bin/mntgen - 775 sys sys 1104122035 135462
+386/bin/mntgen - 775 sys sys 1106453227 139193
 386/bin/mount - 775 sys sys 1104122036 73011
 386/bin/ms2html - 775 sys sys 1104122036 103585
 386/bin/mtime - 775 sys sys 1104122036 59139
@@ -337,7 +337,7 @@
 386/bin/netstat - 775 sys sys 1104122040 84385
 386/bin/news - 775 sys sys 1104122041 71653
 386/bin/nfs - 775 sys sys 1104122041 315389
-386/bin/nm - 775 sys sys 1104122042 115510
+386/bin/nm - 775 sys sys 1106453228 115508
 386/bin/nntpfs - 775 sys sys 1104122042 160898
 386/bin/ns - 775 sys sys 1104122042 65260
 386/bin/p - 775 sys sys 1104122043 64982
@@ -355,7 +355,7 @@
 386/bin/ppm - 775 sys sys 1104122046 148999
 386/bin/pr - 775 sys sys 1104122046 77408
 386/bin/primes - 775 sys sys 1104122046 38793
-386/bin/prof - 775 sys sys 1104122047 104239
+386/bin/prof - 775 sys sys 1106453228 104237
 386/bin/proof - 775 sys sys 1104122047 177611
 386/bin/ps - 775 sys sys 1104122047 65805
 386/bin/pwd - 775 sys sys 1104122047 36897
@@ -386,8 +386,8 @@
 386/bin/sha1sum - 775 sys sys 1104122054 61133
 386/bin/size - 775 sys sys 1104122054 74475
 386/bin/sleep - 775 sys sys 1085077097 3413
-386/bin/snap - 775 sys sys 1104122055 269610
-386/bin/snapfs - 775 sys sys 1104122056 338464
+386/bin/snap - 775 sys sys 1106453229 269608
+386/bin/snapfs - 775 sys sys 1106453230 338462
 386/bin/sniffer - 775 sys sys 1038443185 99028
 386/bin/snoopy - 775 sys sys 1104122056 157546
 386/bin/sort - 775 sys sys 1104122056 82285
@@ -420,7 +420,7 @@
 386/bin/topng - 775 sys sys 1104122065 137679
 386/bin/toppm - 775 sys sys 1104122065 164905
 386/bin/touch - 775 sys sys 1104122066 63763
-386/bin/tprof - 775 sys sys 1104122066 255092
+386/bin/tprof - 775 sys sys 1106453230 255090
 386/bin/tr - 775 sys sys 1104122066 61851
 386/bin/trace - 775 sys sys 1104122067 180734
 386/bin/troff - 775 sys sys 1094040114 357714
@@ -543,7 +543,7 @@
 386/lib/libhttpd.a - 664 sys sys 1105161539 99488
 386/lib/libip.a - 664 sys sys 1105161539 35602
 386/lib/libl.a - 664 sys sys 1105161539 5384
-386/lib/libmach.a - 664 sys sys 1105161540 652274
+386/lib/libmach.a - 664 sys sys 1106453232 652292
 386/lib/libmemdraw.a - 664 sys sys 1105161541 283188
 386/lib/libmemlayer.a - 664 sys sys 1105161541 47360
 386/lib/libmp.a - 664 sys sys 1105161541 79532
@@ -3126,7 +3126,7 @@ rc/bin/ups - 775 sys sys 1091021981 806
 rc/bin/uptime - 775 sys sys 1074730712 234
 rc/bin/usbstart - 775 sys sys 1044894155 81
 rc/bin/usps - 775 sys sys 1016826030 450
-rc/bin/vwhois - 775 sys sys 1097960228 298
+rc/bin/vwhois - 775 sys sys 1106409971 445
 rc/bin/wdoc2txt - 755 sys sys 1017431153 277
 rc/bin/weather - 775 sys sys 1016825765 795
 rc/bin/who - 775 sys sys 945617210 61
@@ -7072,7 +7072,7 @@ sys/src/cmd/aux/mnihongo/mnihongo.c - 664 sys sys 946759402 6406
 sys/src/cmd/aux/mnihongo/tmac.nihongo - 664 sys sys 944960789 22
 sys/src/cmd/aux/mouse.c - 664 sys sys 1063855425 7049
 sys/src/cmd/aux/ms2.c - 664 sys sys 1015008685 3129
-sys/src/cmd/aux/msexceltables.c - 664 sys sys 1105123098 13134
+sys/src/cmd/aux/msexceltables.c - 664 sys sys 1106410108 13282
 sys/src/cmd/aux/mswordstrings.c - 664 sys sys 952201344 5767
 sys/src/cmd/aux/na - 20000000775 sys sys 955036627 0
 sys/src/cmd/aux/na/mkfile - 664 sys sys 955036627 121
@@ -7522,7 +7522,7 @@ sys/src/cmd/faces - 20000000775 sys sys 952888246 0
 sys/src/cmd/faces/dblook.c - 664 sys sys 944961084 359
 sys/src/cmd/faces/facedb.c - 664 sys sys 1062460263 9927
 sys/src/cmd/faces/faces.h - 664 sys sys 1072972232 1115
-sys/src/cmd/faces/main.c - 664 sys sys 1072972232 13637
+sys/src/cmd/faces/main.c - 664 sys sys 1106409986 13643
 sys/src/cmd/faces/mkfile - 664 sys sys 1062460262 355
 sys/src/cmd/faces/plumb.c - 664 sys sys 1072972233 7054
 sys/src/cmd/faces/util.c - 664 sys sys 1035698250 569
@@ -9747,7 +9747,7 @@ sys/src/cmd/mkmany - 664 sys sys 1022112160 1196
 sys/src/cmd/mkone - 664 sys sys 1101311048 835
 sys/src/cmd/mkstate.c - 664 sys sys 1014926695 2995
 sys/src/cmd/mksyslib - 664 sys sys 1022112160 660
-sys/src/cmd/mntgen.c - 664 sys sys 1048644521 3365
+sys/src/cmd/mntgen.c - 664 sys sys 1106410349 3630
 sys/src/cmd/mount.c - 664 sys sys 1034195354 1508
 sys/src/cmd/ms2html.c - 664 sys sys 1084470689 40502
 sys/src/cmd/mtime.c - 664 sys sys 1036172302 450
@@ -12062,7 +12062,7 @@ sys/src/libmach/qdb.c - 664 sys sys 1014929544 27188
 sys/src/libmach/qobj.c - 664 sys sys 1091732625 2310
 sys/src/libmach/setmach.c - 664 sys sys 1089313993 2682
 sys/src/libmach/swap.c - 664 sys sys 964540518 1026
-sys/src/libmach/sym.c - 664 sys sys 1088653081 26582
+sys/src/libmach/sym.c - 664 sys sys 1106409575 26581
 sys/src/libmach/v.c - 664 sys sys 964540518 3403
 sys/src/libmach/vcodas.c - 664 sys sys 1014929545 10253
 sys/src/libmach/vdb.c - 664 sys sys 1014929545 22248

+ 18 - 0
dist/replica/plan9.log

@@ -13268,3 +13268,21 @@
 1106263831 2 c sys/src/cmd/samterm/samterm.h - 664 sys sys 1106263089 3750
 1106281836 0 c 386/bin/aux/samterm - 775 sys sys 1106280481 247878
 1106292637 0 c sys/man/2/9p - 664 sys sys 1106291974 15232
+1106409661 0 c sys/src/libmach/sym.c - 664 sys sys 1106409575 26581
+1106411461 0 c rc/bin/vwhois - 775 sys sys 1106409971 445
+1106411461 1 c sys/src/cmd/aux/msexceltables.c - 664 sys sys 1106410108 13282
+1106411461 2 c sys/src/cmd/faces/main.c - 664 sys sys 1106409986 13643
+1106411461 3 c sys/src/cmd/mntgen.c - 664 sys sys 1106410349 3630
+1106454670 0 c 386/bin/acid - 775 sys sys 1106453224 355754
+1106454670 1 c 386/bin/db - 775 sys sys 1106453226 302164
+1106454670 2 c 386/bin/faces - 775 sys sys 1106453226 192585
+1106454670 3 c 386/bin/snap - 775 sys sys 1106453229 269608
+1106454670 4 c 386/bin/snapfs - 775 sys sys 1106453230 338462
+1106454670 5 c 386/bin/kprof - 775 sys sys 1106453227 99494
+1106454670 6 c 386/bin/ktrace - 775 sys sys 1106453227 113445
+1106454670 7 c 386/bin/nm - 775 sys sys 1106453228 115508
+1106454670 8 c 386/bin/prof - 775 sys sys 1106453228 104237
+1106454670 9 c 386/bin/aux/msexceltables - 775 sys sys 1106453225 80995
+1106454670 10 c 386/bin/mntgen - 775 sys sys 1106453227 139193
+1106454670 11 c 386/bin/tprof - 775 sys sys 1106453230 255090
+1106454670 12 c 386/lib/libmach.a - 664 sys sys 1106453232 652292

+ 10 - 2
rc/bin/vwhois

@@ -1,8 +1,16 @@
 #!/bin/rc
 
-if(test -f /mnt/plumb/seemail || test -f /mnt/term/mnt/plumb/seemail){
+rfork e
+
+box=mbox
+if(! test -d /mail/fs/$box)
+	box=`{ls -p /mail/fs | grep -v ctl | sed 1q}
+if(~ $#box 0)
+	box=mbox	# we tried
+
+if(~ $#box 1 && test -f /mnt/plumb/seemail || test -f /mnt/term/mnt/plumb/seemail){
 	for(i)
-		plumb -dseemail -a 'filetype=vwhois digest='$i.$pid' mailtype=new sender='$i /mail/fs/mbox/XXX
+		plumb -dseemail -a 'filetype=vwhois digest='$i.$pid' mailtype=new sender='$i /mail/fs/$box/XXXvwhois
 }
 if not for (i){
 	echo vwhois: vwhois: vwhois: delivered `{cat /dev/user} From $i '(vwho)' >> /sys/log/mail

+ 74 - 66
sys/src/cmd/aux/msexceltables.c

@@ -284,6 +284,53 @@ release(void)
 	Ncols = -1;
 }
 
+void
+skip(Biff *b, int len)
+{
+	if (Bseek(b->bp, len, 1) == -1)
+		sysfatal("seek failed - %r\n");
+	b->len -= len;
+}
+
+void
+gmem(Biff *b, void *p, int n)
+{
+	if (b->len < n)
+		sysfatal("short record %d < %d\n", b->len, n);
+	if (Bread(b->bp, p, n) != n)
+		sysfatal("unexpected EOF - %r\n");
+	b->len -= n;
+}
+
+void
+xd(Biff *b)
+{
+	uvlong off;
+	uchar buf[16];
+	int addr, got, n, i, j;
+
+	addr = 0;
+	off = Boffset(b->bp);
+	while (addr < b->len){
+		n = (b->len >= sizeof(buf))? sizeof(buf): b->len;
+		got = Bread(b->bp, buf, n);
+
+		Bprint(bo, "	%6d  ", addr);
+		addr += n;
+
+		for (i = 0; i < got; i++)
+			Bprint(bo, "%02x ", buf[i]);
+		for (j = i; j < 16; j++)
+			Bprint(bo, "   ");
+		Bprint(bo, "  ");
+		for (i = 0; i < got; i++)
+			Bprint(bo, "%c", isprint(buf[i])? buf[i]: '.');
+		Bprint(bo, "\n");
+	}
+	Bseek(b->bp, off, 0);
+	off = Boffset(b->bp);
+}
+
 static int 
 getrec(Biff *b)
 {
@@ -302,6 +349,10 @@ getrec(Biff *b)
 	b->len |= c << 8;
 	if (b->op == 0 && b->len == 0)
 		return -1;
+	if (Debug){
+		Bprint(bo, "op=0x%x len=%d\n", b->op, b->len);
+		xd(b);
+	}
 	return 0;
 }
 
@@ -324,24 +375,6 @@ gint(Biff *b, int n)
 	return rc;
 }
 
-void
-skip(Biff *b, int len)
-{
-	if (Bseek(b->bp, len, 1) == -1)
-		sysfatal("seek failed - %r\n");
-	b->len -= len;
-}
-
-void
-gmem(Biff *b, void *p, int n)
-{
-	if (b->len < n)
-		sysfatal("short record %d < %d\n", b->len, n);
-	if (Bread(b->bp, p, n) != n)
-		sysfatal("unexpected EOF - %r\n");
-	b->len -= n;
-}
-
 double
 grk(Biff *b)
 {
@@ -378,22 +411,17 @@ char *
 gstr(Biff *b, int len_width)
 {
 	Rune r;
-	int len, opt;
+	int nch, sz, len, opt;
 	char *buf, *p;
 
-	if (b->len == 0){
+	if (b->len < len_width){
 		if (getrec(b) == -1)
 			sysfatal("expected CONTINUE, got EOF\n");
 		if (b->op != 0x03c)	
 			sysfatal("expected CONTINUE, got op=0x%x\n", b->op);
 	}
 
-	switch(len_width){
-	case 16: len = gint(b, 2); break;
-	case 8:  len = gint(b, 1); break;
-	default: sysfatal("can't happen error\n"); SET(len); break;
-	}
-
+	len = gint(b, len_width);
 	if (Biffver != Ver8){
 		if ((buf = calloc(len+1, sizeof(char))) == nil)
 			sysfatal("no memory\n");
@@ -401,6 +429,7 @@ gstr(Biff *b, int len_width)
 		return buf;
 	}
 
+
 	if ((buf = calloc(len+1, sizeof(char)*UTFmax)) == nil)
 		sysfatal("no memory\n");
 	p = buf;
@@ -408,42 +437,26 @@ gstr(Biff *b, int len_width)
 	if (len == 0)
 		return buf;
 
-	opt = gint(b, 1);
-	if (opt & 0x0c)
-		sysfatal("Can't parse rich or Asian phonetic text - no documentation!\n");
-
-	while(len--){
-		r = gint(b, (opt & 1)? sizeof(Rune): sizeof(char));
-		p += runetochar(p, &r);
+	nch = 0;
+	while (1){
+		opt = gint(b, 1);
+		sz = (opt & 1)? sizeof(Rune): sizeof(char);
+		while(b->len > 0){
+			r = gint(b, sz);
+			p += runetochar(p, &r);
+			if (++nch >= len){
+				return buf;
+			}
+		}
+		if (getrec(b) == -1)
+			sysfatal("expected CONTINUE, got EOF\n");
+		if (b->op != 0x03c)	
+			sysfatal("expected CONTINUE, got op=0x%x\n", b->op);
 	}
+	sysfatal("cannot ever happen error\n");
 	return buf;
 }
 
-void
-xd(Biff *b)
-{
-	uchar buf[16];
-	int addr, n, i, j;
-
-	addr = 0;
-	while (b->len){
-		n = (b->len >= sizeof(buf))? sizeof(buf): b->len;
-		gmem(b, buf, n);
-
-		Bprint(bo, "	%6d  ", addr);
-		addr += n;
-
-		for (i = 0; i < n; i++)
-			Bprint(bo, "%02x ", buf[i]);
-		for (j = i; j < 16; j++)
-			Bprint(bo, "   ");
-		Bprint(bo, "  ");
-		for (i = 0; i < n; i++)
-			Bprint(bo, "%c", isprint(buf[i])? buf[i]: '.');
-		Bprint(bo, "\n");
-	}
-}
-
 void
 sst(Biff *b)
 {
@@ -454,7 +467,7 @@ sst(Biff *b)
 	if ((Strtab = calloc(Nstrtab, sizeof(char *))) == nil)
 		sysfatal("no memory\n");
 	for (n = 0; n < Nstrtab; n++)
-		Strtab[n] = gstr(b, 16);
+		Strtab[n] = gstr(b, 2);
 }
 
 void
@@ -506,7 +519,7 @@ label(Biff *b)
 	int r = gint(b, 2);		// row
 	int c = gint(b, 2);		// col
 	int f = gint(b, 2);		// formatting ref
-	char *s = gstr(b, 16);		// byte string
+	char *s = gstr(b, 2);		// byte string
 	cell(r, c, f, Tlabel, s);
 }
 
@@ -616,7 +629,7 @@ xf(Biff *b)
 void
 writeaccess(Biff *b)
 {
-	Bprint(bo, "# author %s\n", gstr(b, 16));
+	Bprint(bo, "# author %s\n", gstr(b, 2));
 }
 
 void
@@ -659,11 +672,6 @@ xls2csv(Biobuf *bp)
 		for (i = 0; i < nelem(dispatch); i++)
 			if (b->op == dispatch[i].op)
 				(*dispatch[i].func)(b);
-
-		if (Debug && i >= nelem(dispatch)){
-			Bprint(bo, "op=0x%x len=%d\n", b->op, b->len);
-			xd(b);
-		}
 		skip(b, b->len);
 	}
 }

+ 2 - 2
sys/src/cmd/faces/main.c

@@ -599,7 +599,7 @@ click(int button, Mouse *m)
 		}else{
 			for(i=first; i<last; i++)	/* clear vwhois faces */
 				if(ptinrect(p, facerect(i-first)) 
-				&& strstr(faces[i]->str[Sshow], "/mail/fs/mbox/XXX")){
+				&& strstr(faces[i]->str[Sshow], "/XXXvwhois")){
 					delface(i);
 					flushimage(display, 1);
 				}
@@ -674,7 +674,7 @@ startproc(void (*f)(void), int index)
 void
 usage(void)
 {
-	fprint(2, "usage: faces [-hi]\n");
+	fprint(2, "usage: faces [-hi] [-m maildir]\n");
 	exits("usage");
 }
 

+ 20 - 7
sys/src/cmd/mntgen.c

@@ -3,6 +3,8 @@
 #include <fcall.h>
 #include <thread.h>
 #include <9p.h>
+#include <mp.h>
+#include <libsec.h>
 
 static void
 usage(void)
@@ -17,7 +19,7 @@ typedef struct Tab Tab;
 struct Tab
 {
 	char *name;
-	ulong qid;
+	vlong qid;
 	ulong time;
 	int ref;
 };
@@ -25,10 +27,9 @@ struct Tab
 Tab *tab;
 int ntab;
 int mtab;
-ulong qidgen;
 
 static Tab*
-findtab(ulong path)
+findtab(vlong path)
 {
 	int i;
 
@@ -38,6 +39,14 @@ findtab(ulong path)
 	return nil;
 }
 
+static vlong
+hash(char *name)
+{
+	vlong digest[MD5dlen / sizeof(vlong) + 1];
+	md5((uchar *)name, strlen(name), (uchar *)digest, nil);
+	return digest[0] & ((1ULL<<48)-1);
+}
+
 static void
 fsopen(Req *r)
 {
@@ -83,7 +92,7 @@ static void
 fsstat(Req *r)
 {
 	Tab *t;
-	ulong qid;
+	vlong qid;
 
 	qid = r->fid->qid.path;
 	if(qid == 0)
@@ -103,6 +112,7 @@ fswalk1(Fid *fid, char *name, void*)
 {
 	int i;
 	Tab *t;
+	vlong h;
 
 	if(fid->qid.path != 0){
 		/* nothing in child directory */
@@ -123,6 +133,9 @@ fswalk1(Fid *fid, char *name, void*)
 			fid->qid.path = tab[i].qid;
 			return nil;
 		}
+	h = hash(name);
+	if(findtab(h) != nil)
+		return "hash collision";
 
 	/* create it */
 	if(ntab == mtab){
@@ -132,7 +145,7 @@ fswalk1(Fid *fid, char *name, void*)
 			mtab *= 2;
 		tab = erealloc9p(tab, sizeof(tab[0])*mtab);
 	}
-	tab[ntab].qid = ++qidgen;
+	tab[ntab].qid = h;
 	fid->qid.path = tab[ntab].qid;
 	tab[ntab].name = estrdup9p(name);
 	tab[ntab].time = time(0);
@@ -162,13 +175,13 @@ static void
 fsclunk(Fid *fid)
 {
 	Tab *t;
-	ulong qid;
+	vlong qid;
 
 	qid = fid->qid.path;
 	if(qid == 0)
 		return;
 	if((t = findtab(qid)) == nil){
-		fprint(2, "warning: cannot find %lux\n", qid);
+		fprint(2, "warning: cannot find %llux\n", qid);
 		return;
 	}
 	if(--t->ref == 0){

+ 2 - 3
sys/src/libmach/sym.c

@@ -356,13 +356,12 @@ buildtbls(void)
 			return 0;
 		}
 	}
-	fmax++;
-	fnames = malloc(fmax*sizeof(*fnames));
+	fnames = malloc((fmax+1)*sizeof(*fnames));
 	if (!fnames) {
 		werrstr("can't malloc file name table");
 		return 0;
 	}
-	memset(fnames, 0, fmax*sizeof(*fnames));
+	memset(fnames, 0, (fmax+1)*sizeof(*fnames));
 	files = malloc(nfiles*sizeof(*files));
 	if(!files) {
 		werrstr("can't malloc file table");