pioctl.c: restore required result variable
[openafs.git] / src / sys / iwrite.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #include <afsconfig.h>
11 #include <afs/param.h>
12
13 #include <roken.h>
14
15 #include "AFS_component_version_number.c"
16
17 main(argc, argv)
18      char **argv;
19 {
20
21     struct stat status;
22     int count;
23
24     if (stat("/vicepa", &status) == -1) {
25         perror("stat");
26         exit(1);
27     }
28     if (--argc != 4) {
29         printf("Usage: iwrite inode offset string count\n");
30         exit(1);
31     }
32     count =
33         xiwrite(status.st_dev, atoi(argv[1]), 17, atoi(argv[2]), argv[3],
34                 atoi(argv[4]));
35     if (count == -1) {
36         perror("iwrite");
37         exit(1);
38     }
39     printf("iwrite successful, count==%d\n", count);
40     exit(0);
41 }