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