diff options
author | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
---|---|---|
committer | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
commit | e5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch) | |
tree | d8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/cmd/venti/srv/printmap.c |
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/cmd/venti/srv/printmap.c')
-rwxr-xr-x | sys/src/cmd/venti/srv/printmap.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sys/src/cmd/venti/srv/printmap.c b/sys/src/cmd/venti/srv/printmap.c new file mode 100755 index 000000000..f3392ef81 --- /dev/null +++ b/sys/src/cmd/venti/srv/printmap.c @@ -0,0 +1,42 @@ +#include "stdinc.h" +#include "dat.h" +#include "fns.h" + +void +usage(void) +{ + fprint(2, "usage: printmap [-B blockcachesize] config\n"); + threadexitsall("usage"); +} + +Config conf; + +void +threadmain(int argc, char *argv[]) +{ + u32int bcmem; + int fix; + + fix = 0; + bcmem = 0; + ARGBEGIN{ + case 'B': + bcmem = unittoull(ARGF()); + break; + default: + usage(); + break; + }ARGEND + + if(!fix) + readonly = 1; + + if(argc != 1) + usage(); + + if(initventi(argv[0], &conf) < 0) + sysfatal("can't init venti: %r"); + + printindex(1, mainindex); + threadexitsall(0); +} |