Whamcloud - gitweb
- build truncate with LARGEFILE64_SOURCE
authorpschwan <pschwan>
Mon, 25 Mar 2002 01:55:49 +0000 (01:55 +0000)
committerpschwan <pschwan>
Mon, 25 Mar 2002 01:55:49 +0000 (01:55 +0000)
- truncate's second argument is now in KB

lustre/tests/Makefile.am
lustre/tests/truncate.c

index fd2ab55..dcd1b6d 100644 (file)
@@ -1,4 +1,4 @@
-CFLAGS:=-g -I. -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I../include -Wall
+CFLAGS:=-g -I. -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I../include -Wall -D_LARGEFILE64_SOURCE
 KFLAGS:=
 CPPFLAGS :=
 # LDADD := -lreadline -ltermcap # -lefence
index 66634dd..70fbbc7 100644 (file)
@@ -6,16 +6,17 @@
 
 int main(int argc, char **argv)
 {
-       unsigned long off;
+       unsigned long long off;
        int err;
 
        if (argc != 3) { 
-               printf("usage %s file offset\n", argv[0]); 
+               printf("usage %s file offset (kilobytes)\n", argv[0]); 
                return 1;
        }
 
        off = strtoul(argv[2], NULL, 0);
-       err = truncate(argv[1], off); 
+       off *= 1024;
+       err = truncate64(argv[1], off); 
        if ( err ) { 
                printf("Error truncating %s: %s\n", argv[1], strerror(errno));
        }