Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af006c4
)
*** empty log message ***
author
braam
<braam>
Thu, 21 Feb 2002 23:02:57 +0000
(23:02 +0000)
committer
braam
<braam>
Thu, 21 Feb 2002 23:02:57 +0000
(23:02 +0000)
lustre/tests/truncate.c
[new file with mode: 0644]
patch
|
blob
diff --git a/lustre/tests/truncate.c
b/lustre/tests/truncate.c
new file mode 100644
(file)
index 0000000..
66634dd
--- /dev/null
+++ b/
lustre/tests/truncate.c
@@ -0,0
+1,23
@@
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv)
+{
+ unsigned long off;
+ int err;
+
+ if (argc != 3) {
+ printf("usage %s file offset\n", argv[0]);
+ return 1;
+ }
+
+ off = strtoul(argv[2], NULL, 0);
+ err = truncate(argv[1], off);
+ if ( err ) {
+ printf("Error truncating %s: %s\n", argv[1], strerror(errno));
+ }
+ return err;
+}