remove thread.c
This commit is contained in:
parent
b4e8c4b6d6
commit
c66e8adfa3
2 changed files with 0 additions and 35 deletions
|
|
@ -5,7 +5,6 @@ OFILES=\
|
|||
event.$O\
|
||||
fid.$O\
|
||||
mesg.$O\
|
||||
thread.$O\
|
||||
|
||||
HFILES=$PLAN9/include/plumb.h
|
||||
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <thread.h>
|
||||
#include <fcall.h>
|
||||
#include <fs.h>
|
||||
#include "plumb.h"
|
||||
|
||||
Plumbmsg*
|
||||
ioplumbrecv(Ioproc *io, int fd)
|
||||
{
|
||||
char *buf;
|
||||
Plumbmsg *m;
|
||||
int n, more;
|
||||
|
||||
buf = malloc(8192);
|
||||
if(buf == nil)
|
||||
return nil;
|
||||
n = ioread(io, fd, buf, 8192);
|
||||
m = nil;
|
||||
if(n > 0){
|
||||
m = plumbunpackpartial(buf, n, &more);
|
||||
if(m==nil && more>0){
|
||||
/* we now know how many more bytes to read for complete message */
|
||||
buf = realloc(buf, n+more);
|
||||
if(buf == nil)
|
||||
return nil;
|
||||
if(ioreadn(io, fd, buf+n, more) == more)
|
||||
m = plumbunpackpartial(buf, n+more, nil);
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
return m;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue