diff options
author | rsc <devnull@localhost> | 2003-11-23 17:55:34 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2003-11-23 17:55:34 +0000 |
commit | 7763a61a3582ef330bca54f225e8ec5325fbd35e (patch) | |
tree | 952957eef4d70ecbd30c58e3a0dacd6b3a753a54 /src/cmd/vac/wtest.c | |
parent | 7a4ee46d253e291044bba2d0c54b818b67ac013c (diff) | |
download | plan9port-7763a61a3582ef330bca54f225e8ec5325fbd35e.tar.gz plan9port-7763a61a3582ef330bca54f225e8ec5325fbd35e.tar.bz2 plan9port-7763a61a3582ef330bca54f225e8ec5325fbd35e.zip |
start thinking about vac -- doesn't build yet
Diffstat (limited to 'src/cmd/vac/wtest.c')
-rw-r--r-- | src/cmd/vac/wtest.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/cmd/vac/wtest.c b/src/cmd/vac/wtest.c new file mode 100644 index 00000000..3cc15e9c --- /dev/null +++ b/src/cmd/vac/wtest.c @@ -0,0 +1,47 @@ +#include "stdinc.h" + +enum { + Nblock = 10000, + BlockSize = 8*1024, +}; + +uchar data[Nblock*BlockSize]; + +void +main(int argc, char *argv[]) +{ + VtSession *z; + int i; + uchar score[VtScoreSize]; + int start; + + ARGBEGIN{ + }ARGEND + + for(i=0; i<Nblock; i++) { + if(readn(0, data+i*BlockSize, BlockSize) < BlockSize) + sysfatal("read failed: %r"); + } + + vtAttach(); + + z = vtDial("iolaire2"); + if(z == nil) + sysfatal("cound not connect to venti"); + if(!vtConnect(z, 0)) + vtFatal("vtConnect: %s", vtGetError()); + + print("starting\n"); + + start = times(0); + + for(i=0; i<Nblock; i++) { + if(!vtWrite(z, score, VtDataType, data+i*BlockSize, BlockSize)) + vtFatal("vtWrite failed: %s", vtGetError()); + } + + print("time = %f\n", (times(0) - start)*0.001); + + vtClose(z); + vtDetach(); +} |