Whamcloud - gitweb
lock descriptor fixups
[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 bytes\n", argv[0]);
14                 return 1;
15         }
16
17         off = strtoull(argv[2], NULL, 0);
18         err = truncate64(argv[1], off);
19         if ( err )
20                 printf("Error truncating %s: %s\n", argv[1], strerror(errno));
21
22         return err;
23 }