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_fixcpp/sys/src/liboventi/readfully.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 <u.h>
2
#include <libc.h>
3
#include <oventi.h>
4
#include "session.h"
5
 
6
int
7
vtFdReadFully(int fd, uchar *p, int n)
8
{
9
	int nn;
10
 
11
	while(n > 0) {
12
		nn = vtFdRead(fd, p, n);
13
		if(nn <= 0)
14
			return 0;
15
		n -= nn;
16
		p += nn;
17
	}
18
	return 1;
19
}