From 5a8e63b2f016735364d17866d5e2bcb35d20c78b Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 29 Feb 2004 22:10:26 +0000 Subject: Fighting the good fight. Move libfmt, libutf into subdirectories of lib9. Add poll-based socket i/o to libthread, so that we can avoid using multiple procs when possible, thus removing dependence on crappy pthreads implementations. Convert samterm, acme to the single-proc libthread. Bring libcomplete, acme up-to-date w.r.t. Plan 9 distribution. --- src/libfs/fs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libfs/fs.c') diff --git a/src/libfs/fs.c b/src/libfs/fs.c index 91d4af17..d912391f 100644 --- a/src/libfs/fs.c +++ b/src/libfs/fs.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "fsimpl.h" static int _fssend(Mux*, void*); @@ -270,7 +271,7 @@ _fsrecv(Mux *mux) Fsys *fs; fs = mux->aux; - n = readn(fs->fd, buf, 4); + n = threadreadn(fs->fd, buf, 4); if(n != 4) return nil; n = GBIT32(buf); @@ -280,12 +281,12 @@ _fsrecv(Mux *mux) return nil; } PBIT32(pkt, n); - if(readn(fs->fd, pkt+4, n-4) != n-4){ + if(threadreadn(fs->fd, pkt+4, n-4) != n-4){ free(pkt); return nil; } if(pkt[4] == Ropenfd){ - if((nfd=recvfd(fs->fd)) < 0){ + if((nfd=threadrecvfd(fs->fd)) < 0){ fprint(2, "recv fd error: %r\n"); free(pkt); return nil; -- cgit v1.2.3