thandle 64-bit file sizes - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit b707cb51ed57c8d189a2e9f96ee31fa41a63e18c
 (DIR) parent d9e16d252a4f84a6b30a7837ed6524e2dffec5ec
 (HTM) Author: rsc <devnull@localhost>
       Date:   Sun, 13 Jun 2004 20:08:00 +0000
       
       handle 64-bit file sizes
       
       Diffstat:
         M src/cmd/look.c                      |       4 ++--
         M src/cmd/tail.c                      |      14 +++++++-------
       
       2 files changed, 9 insertions(+), 9 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/look.c b/src/cmd/look.c
       t@@ -162,8 +162,8 @@ main(int argc, char *argv[])
        int
        locate(void)
        {
       -        long top, bot, mid;
       -        long c;
       +        vlong top, bot, mid;
       +        int c;
                int n;
        
                bot = 0;
 (DIR) diff --git a/src/cmd/tail.c b/src/cmd/tail.c
       t@@ -8,7 +8,7 @@
         * the simple command tail -c, legal in v10, is illegal
         */
        
       -long        count;
       +vlong        count;
        int        anycount;
        int        follow;
        int        file        = 0;
       t@@ -41,7 +41,7 @@ extern        void        suffix(char*);
        extern        long        tread(char*, long);
        #define trunc tailtrunc
        extern        void        trunc(Dir*, Dir**);
       -extern        long        tseek(long, int);
       +extern        vlong        tseek(vlong, int);
        extern        void        twrite(char*, long);
        extern        void        usage(void);
        
       t@@ -85,7 +85,7 @@ main(int argc, char **argv)
                if(dir==REV && (units==CHARS || follow || origin==BEG))
                        fatal("incompatible options");
                if(!anycount)
       -                count = dir==REV? ~0UL>>1: 10;
       +                count = dir==REV? ~0ULL>>1: 10;
                if(origin==BEG && units==LINES && count>0)
                        count--;
                if(argc > 2)
       t@@ -126,7 +126,7 @@ void
        trunc(Dir *old, Dir **new)
        {
                Dir *d;
       -        ulong olength;
       +        vlong olength;
        
                d = dirfstat(file);
                if(d == nil)
       t@@ -268,7 +268,7 @@ reverse(void)
                long n = 0;
                long bufsiz = 0;
                char *buf = 0;
       -        long pos = tseek(0L, 2);
       +        vlong pos = tseek(0L, 2);
        
                for(first=1; pos>0 && count>0; first=0) {
                        n = pos>Bsize? Bsize: (int)pos;
       t@@ -301,8 +301,8 @@ reverse(void)
                        twrite(buf, len);
        }
        
       -long
       -tseek(long o, int p)
       +vlong
       +tseek(vlong o, int p)
        {
                o = seek(file, o, p);
                if(o == -1)