2 * Copyright 2000, International Business Machines Corporation and others.
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
10 #include <afsconfig.h>
11 #include <afs/param.h>
15 #include <sys/types.h>
20 #include "afssyscalls.h"
22 #include <sys/mknod.h>
25 #include "AFS_component_version_number.c"
29 printf("Usage: iopen <partition> <inode>\n");
30 printf("iopen opens file by inode, then tries to read it, printing it to stdout.\n");
43 if (argc != 3) Usage();
46 #ifdef AFS_64BIT_IOPS_ENV
47 ino = strtoull(argv[2], NULL, 10);
52 if (stat(part, &status) == -1) {
56 printf("ino=%lld\n", ino);
57 printf("About to iopen(dev=(%d,%d), inode=%s, mode=%d\n",
58 major(status.st_dev), minor(status.st_dev), PrintInode(NULL, ino),
61 fd = IOPEN(status.st_dev, ino, O_RDONLY);
66 printf("iopen successful, fd=%d\n", fd);
67 while ((n = read(fd, buf, 5)) > 0)