Use an anonymous pointer for lpioctl
[openafs.git] / src / sys / idec.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 #include <afs/afssyscalls.h>
19 #ifdef AFS_HPUX_ENV
20 #include <sys/mknod.h>
21 #endif
22
23 main(argc, argv)
24      char **argv;
25 {
26
27     int fd;
28     struct stat status;
29
30     if (argc < 3) {
31         printf(" Usage is %s <partition> <inode>\n", argv[0]);
32         exit(0);
33     }
34
35     if (stat(argv[1], &status) == -1) {
36         perror("stat");
37         exit(1);
38     }
39     printf("About to idec(dev=(%d), inode=%d)\n", status.st_dev,
40            atoi(argv[2]));
41     fflush(stdout);
42     fd = IDEC(status.st_dev, atoi(argv[2]), 17);
43     if (fd == -1) {
44         perror("iopen");
45         exit(1);
46     }
47     exit(0);
48 }