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 @@ -22,6 +22,25 @@ static int dolong = 1; 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) { 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 #include #include +