From 7a4ee46d253e291044bba2d0c54b818b67ac013c Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 23 Nov 2003 17:54:58 +0000 Subject: Initial stab at Venti. --- src/cmd/venti/write.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/cmd/venti/write.c (limited to 'src/cmd/venti/write.c') diff --git a/src/cmd/venti/write.c b/src/cmd/venti/write.c new file mode 100644 index 00000000..94b61be4 --- /dev/null +++ b/src/cmd/venti/write.c @@ -0,0 +1,60 @@ +#include "stdinc.h" +#include "dat.h" +#include "fns.h" + +char *host; + +void +usage(void) +{ + fprint(2, "usage: write [-z] [-h host] [-t type] VtMaxLumpSize) + sysfatal("data too big"); + z = vtdial(host); + if(z == nil) + sysfatal("could not connect to server: %r"); + if(vtconnect(z) < 0) + sysfatal("vtconnect: %r"); + if(dotrunc) + n = vtzerotruncate(type, p, n); + if(vtwrite(z, score, type, p, n) < 0) + sysfatal("vtwrite: %r"); + vthangup(z); + print("%V\n", score); + threadexitsall(0); +} -- cgit v1.2.3