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 /* ltlist - a standalone program to dump the link count table. */
12 #include <afsconfig.h>
13 #include <afs/param.h>
22 main(int ac
, char **av
)
31 printf("Usage ltlist <filename>\n");
35 fp
= fopen(av
[1], "r");
37 printf("Can't open %s for reading.\n");
41 /* Print the magic and version numbers in hex. */
42 count
= fread((void *)stamp
, 1, 8, fp
);
45 printf("Only read %d bytes of %s, wanted 8 for stamp.\n", count
,
49 printf("NT Error %d reading 8 bytes from %s\n", GetLastError(),
58 printf("magic=0x%x, version=0x%x\n", stamp
[0], stamp
[1]);
60 printf("%10s %2s %2s %2s %2s %2s\n", "Vnode", "F1", "F2", "F3", "F4",
63 while (fread((void *)&row
, 1, 2, fp
)) {
64 printf("%10d %2d %2d %2d %2d %2d\n", i
, (int)(row
& 0x7),
65 (int)((row
>> 3) & 0x7), (int)((row
>> 6) & 0x7),
66 (int)((row
>> 9) & 0x7), (int)((row
>> 12) & 0x7));