debugging for sam, and an old fix forgotten
diff --git a/src/cmd/9term/rcstart.c b/src/cmd/9term/rcstart.c
index 1aa46dc..edf161c 100644
--- a/src/cmd/9term/rcstart.c
+++ b/src/cmd/9term/rcstart.c
@@ -24,6 +24,7 @@
 		_exit(2);
 	default:
 		waitpid();
+fprint(2, "done waiting\n");
 	}
 }
 
diff --git a/src/cmd/mkfile b/src/cmd/mkfile
index 51e6ed6..ea036ac 100644
--- a/src/cmd/mkfile
+++ b/src/cmd/mkfile
@@ -4,7 +4,7 @@
 
 <$PLAN9/src/mkmany
 
-BUGGERED='CVS|faces|factotum|mailfs|page|scat|upas|venti|vncv|postscript|mnihongo|mpm|index'
+BUGGERED='CVS|acid|db|faces|factotum|mailfs|page|scat|upas|venti|vncv|postscript|mnihongo|mpm|index'
 DIRS=lex `ls -l |sed -n 's/^d.* //p' |egrep -v "^($BUGGERED)$"|egrep -v '^lex$'`
 
 <$PLAN9/src/mkdirs
diff --git a/src/cmd/samterm/io.c b/src/cmd/samterm/io.c
index 30a707a..d9cf2e8 100644
--- a/src/cmd/samterm/io.c
+++ b/src/cmd/samterm/io.c
@@ -33,20 +33,27 @@
 initio(void)
 {
 	threadsetname("main");
+	if(protodebug) print("mouse\n");
 	mousectl = initmouse(nil, display->image);
 	if(mousectl == nil){
 		fprint(2, "samterm: mouse init failed: %r\n");
 		threadexitsall("mouse");
 	}
 	mousep = &mousectl->m;
+	if(protodebug) print("kbd\n");
 	keyboardctl = initkeyboard(nil);
 	if(keyboardctl == nil){
 		fprint(2, "samterm: keyboard init failed: %r\n");
 		threadexitsall("kbd");
 	}
+	if(protodebug) print("hoststart\n");
 	hoststart();
-	if(plumbstart() < 0)
+	if(protodebug) print("plumbstart\n");
+	if(plumbstart() < 0){
+		if(protodebug) print("extstart\n");
 		extstart();
+	}
+	if(protodebug) print("initio done\n");
 }
 
 void
diff --git a/src/cmd/samterm/main.c b/src/cmd/samterm/main.c
index 9a485b5..c56ea5f 100644
--- a/src/cmd/samterm/main.c
+++ b/src/cmd/samterm/main.c
@@ -44,15 +44,22 @@
 	close(0);
 	close(1);
 	open("/dev/null", OREAD);
-	dup(2, 1);
+	if(open("/dev/tty", OWRITE) < 0)
+		open("/dev/null", OWRITE);
+dup(2, 1);
 
+	if(protodebug) print("getscreen\n");
 	getscreen(argc, argv);
+	if(protodebug) print("iconinit\n");
 	iconinit();
+	if(protodebug) print("initio\n");
 	initio();
+	if(protodebug) print("scratch\n");
 	scratch = alloc(100*RUNESIZE);
 	nscralloc = 100;
 	r = screen->r;
 	r.max.y = r.min.y+Dy(r)/5;
+	if(protodebug) print("flstart\n");
 	flstart(screen->clipr);
 	rinit(&cmd.rasp);
 	flnew(&cmd.l[0], gettext, 1, &cmd);
@@ -64,6 +71,7 @@
 	startnewfile(Tstartcmdfile, &cmd);
 
 	got = 0;
+	if(protodebug) print("loop\n");
 	for(;;got = waitforio()){
 		if(hasunlocked && RESIZED())
 			resize();
diff --git a/src/cmd/samterm/plan9.c b/src/cmd/samterm/plan9.c
index e860ea5..5f5c33d 100644
--- a/src/cmd/samterm/plan9.c
+++ b/src/cmd/samterm/plan9.c
@@ -158,7 +158,7 @@
 		}
 	}
 
-	fd = open(exname, OREAD|O_NONBLOCK);
+	fd = open(exname, OREAD|ONONBLOCK);
 	if(fd == -1){
 		removeextern();
 		return;
diff --git a/src/lib9/open.c b/src/lib9/open.c
index 896ca52..e76aabe 100644
--- a/src/lib9/open.c
+++ b/src/lib9/open.c
@@ -28,6 +28,10 @@
 		umode |= O_DIRECT;
 		mode ^= ODIRECT;
 	}
+	if(mode&ONONBLOCK){
+		umode |= O_NONBLOCK;
+		mode ^= ONONBLOCK;
+	}
 	if(mode){
 		werrstr("mode 0x%x not supported", mode);
 		return -1;
diff --git a/src/libmach/SunOS.c b/src/libmach/SunOS.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/libmach/SunOS.c
diff --git a/src/libmach/mkfile b/src/libmach/mkfile
index 53d1af9..25a3a87 100644
--- a/src/libmach/mkfile
+++ b/src/libmach/mkfile
@@ -67,7 +67,7 @@
 	$LD -o $target $prereq -l9
 
 
-SunOS.$O: nosys.c
+#SunOS.$O: nosys.c
 Darwin.$O: nosys.c
 OpenBSD.$O: nosys.c
 NetBSD.$O: nosys.c