Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / sys / iinc.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
22 main(argc, argv)
23 char **argv;
24 {
25
26 int fd;
27 struct stat status;
28
29 if (argc < 3) {
30 printf(" Usage is %s <partition> <inode>\n", argv[0]);
31 exit(0);
32 }
33
34 if (stat(argv[1], &status) == -1) {
35 perror("stat");
36 exit(1);
37 }
38 printf("About to iinc(dev=(%d), inode=%d)\n", status.st_dev,
39 atoi(argv[2]));
40 fflush(stdout);
41 fd = IINC(status.st_dev, atoi(argv[2]), 17);
42 if (fd == -1) {
43 perror("iopen");
44 exit(1);
45 }
46 exit(0);
47 }