diff options
author | rsc <devnull@localhost> | 2004-12-27 00:36:40 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-12-27 00:36:40 +0000 |
commit | 2b9172c7d4f8f3f773946e1aab4f9376f50b4cf7 (patch) | |
tree | 749994e4305c3572e8dea720f3ab43b5404bab76 /src/cmd/mk | |
parent | 93f2ae0d92e0ed88fef8265194024606b78d58c6 (diff) | |
download | plan9port-2b9172c7d4f8f3f773946e1aab4f9376f50b4cf7.tar.gz plan9port-2b9172c7d4f8f3f773946e1aab4f9376f50b4cf7.tar.bz2 plan9port-2b9172c7d4f8f3f773946e1aab4f9376f50b4cf7.zip |
add readn to avoid need for plan9port libc
Diffstat (limited to 'src/cmd/mk')
-rw-r--r-- | src/cmd/mk/archive.c | 19 | ||||
-rw-r--r-- | src/cmd/mk/sys.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/cmd/mk/archive.c b/src/cmd/mk/archive.c index 8edfdddc..fcfee03b 100644 --- a/src/cmd/mk/archive.c +++ b/src/cmd/mk/archive.c @@ -23,6 +23,25 @@ static void atimes(char *); static char *split(char*, char**); long +readn(int f, void *av, long n) +{ + char *a; + long m, t; + + a = av; + t = 0; + while(t < n){ + m = read(f, a+t, n-t); + if(m <= 0){ + if(t == 0) + return m; + break; + } + t += m; + } + return t; +} +long atimeof(int force, char *name) { Symtab *sym; diff --git a/src/cmd/mk/sys.h b/src/cmd/mk/sys.h index f520b066..03a9d058 100644 --- a/src/cmd/mk/sys.h +++ b/src/cmd/mk/sys.h @@ -2,3 +2,4 @@ #include <libc.h> #include <bio.h> #include <regexp.h> + |