Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
b=5188
[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 to %Ld: %s\n", argv[1], off,
21
strerror(errno));
22
23
return err;
24
}