Small tweaks
Lots of new code imported.
This commit is contained in:
parent
a770daa795
commit
2277c5d7bb
86 changed files with 12444 additions and 91 deletions
|
|
@ -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*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue