afsconfig-and-rcsid-all-around-20010705
[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 <afs/param.h>
11 #include <afsconfig.h>
12
13 RCSID("$Header$");
14
15 #include <sys/types.h>
16 #include <sys/stat.h>
17 #include <sys/file.h>
18 #include <stdio.h>
19 #include <afs/afssyscalls.h>
20 #ifdef AFS_HPUX_ENV
21 #include <sys/mknod.h>
22 #endif
23
24 main(argc,argv)
25 char **argv;
26 {
27     
28     int fd;
29     struct stat status;
30
31     if ( argc < 3 ) {
32         printf(" Usage is %s <partition> <inode>\n", argv[0]);
33         exit(0);
34     }
35
36     if (stat(argv[1], &status) == -1) {
37         perror("stat");
38         exit(1);
39     }
40     printf("About to iinc(dev=(%d), inode=%d)\n",
41         status.st_dev, atoi(argv[2]));
42     fflush(stdout);
43     fd = IINC(status.st_dev, atoi(argv[2]), 17);
44     if (fd == -1) {
45         perror("iopen");
46         exit(1);
47     }
48     exit(0);
49 }