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_tlsv12/sys/src/cmd/auth/lib/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 <u.h>
2
#include <libc.h>
3
#include <bio.h>
4
#include "authcmdlib.h"
5
 
6
/*
7
 *  read exactly len bytes
8
 */
9
int
10
readn(int fd, char *buf, int len)
11
{
12
	int m, n;
13
 
14
	for(n = 0; n < len; n += m){
15
		m = read(fd, buf+n, len-n);
16
		if(m <= 0)
17
			return -1;
18
	}
19
	return n;
20
}