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>
16 #include <sys/types.h>
21 #include "afssyscalls.h"
23 #include <sys/mknod.h>
26 #include "AFS_component_version_number.c"
31 printf("Usage: iopen <partition> <inode>\n");
33 ("iopen opens file by inode, then tries to read it, printing it to stdout.\n");
50 #ifdef AFS_64BIT_IOPS_ENV
51 ino = strtoull(argv[2], NULL, 10);
56 if (stat(part, &status) == -1) {
60 printf("ino=%lld\n", ino);
61 printf("About to iopen(dev=(%d,%d), inode=%s, mode=%d\n",
62 major(status.st_dev), minor(status.st_dev), PrintInode(NULL, ino),
65 fd = IOPEN(status.st_dev, ino, O_RDONLY);
70 printf("iopen successful, fd=%d\n", fd);
71 while ((n = read(fd, buf, 5)) > 0)