Small tweaks

Lots of new code imported.
This commit is contained in:
rsc 2004-03-21 04:33:13 +00:00
parent a770daa795
commit 2277c5d7bb
86 changed files with 12444 additions and 91 deletions

View file

@ -259,7 +259,7 @@ _fssend(Mux *mux, void *pkt)
Fsys *fs;
fs = mux->aux;
return write(fs->fd, pkt, GBIT32((uchar*)pkt));
return threadwrite(fs->fd, pkt, GBIT32((uchar*)pkt));
}
static void*

View file

@ -52,3 +52,21 @@ fsread(Fid *fid, void *buf, long n)
{
return fspread(fid, buf, n, -1);
}
long
fsreadn(Fid *fid, void *buf, long n)
{
long tot, nn;
for(tot=0; tot<n; tot+=nn){
nn = fsread(fid, (char*)buf+tot, n-tot);
if(nn <= 0){
if(tot == 0)
return nn;
break;
}
}
return tot;
}