]> git.lizzy.rs Git - plan9front.git/blob - sys/src/liboventi/readfully.c
ether8169: fix Macv45
[plan9front.git] / sys / src / liboventi / readfully.c
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 }