Initial stab at Venti.

This commit is contained in:
rsc 2003-11-23 17:54:58 +00:00
parent 4fbfdd7acd
commit 7a4ee46d25
52 changed files with 9527 additions and 0 deletions

48
src/cmd/venti/sync.c Normal file
View file

@ -0,0 +1,48 @@
#include "stdinc.h"
#include "dat.h"
#include "fns.h"
char *host;
void
usage(void)
{
fprint(2, "usage: sync [-h host]\n");
threadexitsall("usage");
}
void
threadmain(int argc, char *argv[])
{
VtConn *z;
ARGBEGIN{
case 'h':
host = EARGF(usage());
if(host == nil)
usage();
break;
default:
usage();
break;
}ARGEND
if(argc != 0)
usage();
fmtinstall('V', vtscorefmt);
z = vtdial(host);
if(z == nil)
sysfatal("could not connect to server: %r");
if(vtconnect(z) < 0)
sysfatal("vtconnect: %r");
if(vtsync(z) < 0)
sysfatal("vtsync: %r");
vthangup(z);
threadexitsall(0);
}