aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/tail.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-06-13 20:08:00 +0000
committerrsc <devnull@localhost>2004-06-13 20:08:00 +0000
commitb707cb51ed57c8d189a2e9f96ee31fa41a63e18c (patch)
tree71e59a160ecd49bd3ae4c22339fb4c59ffeb9f37 /src/cmd/tail.c
parentd9e16d252a4f84a6b30a7837ed6524e2dffec5ec (diff)
downloadplan9port-b707cb51ed57c8d189a2e9f96ee31fa41a63e18c.tar.gz
plan9port-b707cb51ed57c8d189a2e9f96ee31fa41a63e18c.tar.bz2
plan9port-b707cb51ed57c8d189a2e9f96ee31fa41a63e18c.zip
handle 64-bit file sizes
Diffstat (limited to 'src/cmd/tail.c')
-rw-r--r--src/cmd/tail.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/tail.c b/src/cmd/tail.c
index 73e2b2d4..db29986d 100644
--- a/src/cmd/tail.c
+++ b/src/cmd/tail.c
@@ -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;
@@ -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);
@@ -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)
@@ -126,7 +126,7 @@ void
trunc(Dir *old, Dir **new)
{
Dir *d;
- ulong olength;
+ vlong olength;
d = dirfstat(file);
if(d == nil)
@@ -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;
@@ -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)