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>
14 #include <sys/types.h>
19 #include "afssyscalls.h"
21 #include <sys/mknod.h>
24 #include "AFS_component_version_number.c"
29 printf("Usage: iopen <partition> <inode>\n");
31 ("iopen opens file by inode, then tries to read it, printing it to stdout.\n");
48 #ifdef AFS_64BIT_IOPS_ENV
49 ino = strtoull(argv[2], NULL, 10);
54 if (stat(part, &status) == -1) {
58 printf("ino=%" AFS_INT64_FMT "\n", ino);
59 printf("About to iopen(dev=(%d,%d), inode=%s, mode=%d\n",
60 major(status.st_dev), minor(status.st_dev), PrintInode(NULL, ino),
63 fd = IOPEN(status.st_dev, ino, O_RDONLY);
68 printf("iopen successful, fd=%d\n", fd);
69 while ((n = read(fd, buf, 5)) > 0)