Whamcloud - gitweb
Clean and restart up before running the removal test.
[fs/lustre-release.git] / lustre / tests / truncate.c
1 #include <unistd.h>
2 #include <stdio.h>
3 #include <errno.h>
4 #include <string.h>
5 #include <stdlib.h>
6
7 int main(int argc, char **argv)
8 {
9         unsigned long long off;
10         int err;
11
12         if (argc != 3) { 
13                 printf("usage %s file offset (kilobytes)\n", argv[0]); 
14                 return 1;
15         }
16
17         off = strtoul(argv[2], NULL, 0);
18         off *= 1024;
19         err = truncate64(argv[1], off); 
20         if ( err ) { 
21                 printf("Error truncating %s: %s\n", argv[1], strerror(errno));
22         }
23         return err;
24 }