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