Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature-vt/sys/src/cmd/unix/u9fs/readn.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <plan9.h>
2
 
3
long
4
readn(int f, void *av, long n)
5
{
6
	char *a;
7
	long m, t;
8
 
9
	a = av;
10
	t = 0;
11
	while(t < n){
12
		m = read(f, a+t, n-t);
13
		if(m <= 0){
14
			if(t == 0)
15
				return m;
16
			break;
17
		}
18
		t += m;
19
	}
20
	return t;
21
}