trampoline/lib/lib9/write.c

24 lines
260 B
C

#include <u.h>
#define NOPLAN9DEFINES
#include <libc.h>
long
p9write(int f, void *av, long n)
{
char *a;
long m, t;
a = av;
t = 0;
while(t < n){
m = write(f, a+t, n-t);
if(m <= 0){
if(t == 0)
return m;
break;
}
t += m;
}
return t;
}