death to trailing whitespace
[openafs.git] / src / sys / iread.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
14 #include <sys/types.h>
15 #include <sys/stat.h>
16 #include <sys/file.h>
17 #include <stdio.h>
18
19 #include "AFS_component_version_number.c"
20
21 main(argc, argv)
22      char **argv;
23 {
24
25     struct stat status;
26     int count;
27     char buf[50000];
28     if (stat("/vicepa", &status) == -1) {
29         perror("stat");
30         exit(1);
31     }
32     if (--argc != 3) {
33         printf("Usage: iread inode offset count\n");
34         exit(1);
35     }
36     count =
37         xiread(status.st_dev, atoi(argv[1]), 17, atoi(argv[2]), buf,
38                atoi(argv[3]));
39     if (count == -1) {
40         perror("iread");
41         exit(1);
42     }
43     printf("iread(%x) successful, count==%d.  Data follows:\n%s\n",
44            status.st_dev, count, buf);
45     exit(0);
46 }