9 // XXX What to do here?
10 VtMaxLumpSize = 65535,
16 fprint(2, "usage: write [-z] [-h host] [-t type] <datablock\n");
17 threadexitsall("usage");
21 threadmain(int argc, char *argv[])
25 uchar *p, score[VtScoreSize];
28 fmtinstall('F', vtfcallfmt);
29 fmtinstall('V', vtscorefmt);
39 host = EARGF(usage());
42 type = atoi(EARGF(usage()));
52 p = vtmallocz(VtMaxLumpSize+1);
53 n = readn(0, p, VtMaxLumpSize+1);
55 sysfatal("input too big: max block size is %d", VtMaxLumpSize);
58 sysfatal("could not connect to server: %r");
60 sysfatal("vtconnect: %r");
62 n = vtzerotruncate(type, p, n);
63 if(vtwrite(z, score, type, p, n) < 0)
64 sysfatal("vtwrite: %r");