Fix small bugs.
diff --git a/src/libthread/sched.c b/src/libthread/sched.c
index 9ad7298..bdb9ad6 100644
--- a/src/libthread/sched.c
+++ b/src/libthread/sched.c
@@ -171,7 +171,7 @@
 	}
 }
 
-void
+int
 _sched(void)
 {
 	Proc *p;
@@ -186,8 +186,8 @@
 	//		psstate(t->state), &t->sched, &p->sched);
 		if(_setlabel(&t->sched)==0)
 			_gotolabel(&p->sched);
-		_threadstacklimit(t->stk);
-		return;
+		_threadstacklimit(t->stk, t->stk+t->stksize);
+		return p->nsched++;
 	}else{
 		t = runthread(p);
 		if(t == nil){
@@ -277,10 +277,15 @@
 	unlock(&p->readylock);
 }
 
-void
+int
 yield(void)
 {
-	_sched();
+	Proc *p;
+	int nsched;
+
+	p = _threadgetproc();
+	nsched = p->nsched;
+	return _sched() - nsched;
 }
 
 void