VENTI-CLIENT(3)
π NAME π
Welcome to VENTI-CLIENT(3), bestie β the Library Functions Manual page for the whole Venti client squad: vtconnect, vthello, vtread, vtwrite, vtreadpacket, vtwritepacket, vtsync, vtping, vtrpc, and ventidoublechecksha1. That's the cast. π
β¨ SYNOPSIS β¨
#include <u.h>
#include <libc.h>
#include <venti.h>
Packet* vtrpc(VtConn *z, Packet *p)
int vthello(VtConn *z)
int vtconnect(VtConn *z)
int vtread(VtConn *z, uchar score[VtScoreSize],
uint type, uchar *buf, int n)
int vtwrite(VtConn *z, uchar score[VtScoreSize],
uint type, uchar *buf, int n)
Packet* vtreadpacket(VtConn *z, uchar score[VtScoreSize],
uint type, int n)
int vtwritepacket(VtConn *z, uchar score[VtScoreSize],
uint type, Packet *p)
int vtsync(VtConn *z)
int vtping(VtConn *z)
extern int ventidoublechecksha1; /* default 1 */
π DESCRIPTION π
These routines execute the client side of the venti(7) protocol. Periodt. π
Vtrpcβ executes a single Venti RPC transaction, sending the request packetpand then waiting for and returning the response packet.Vtrpcwill set the tag in the packet.Vtrpcfreesp, even on error.Vtrpcis typically called only indirectly, via the functions below.Vthelloβ executes a hello transaction, settingz->sidto the name used by the server.Vthellois typically called only indirectly, viavtconnect.Vtconnectβ callsvtversion(seeventi-conn(3)) andvthello, in that order, returning success only if both succeed. This sequence (callingvtversionand thenvthello) must be done before the functions below can be called.Vtreadβ reads the block with the given score and type from the server, stores the returned data in memory atbuf, and returns the number of bytes read. If the server's block has size larger thann,vtreaddoes not modifybufand returns an error.Vtwriteβ writes thenbytes inbufas a block of the given type, settingscore.Vtreadpacketandvtwritepacketβ are likevtreadandvtwritebut return or accept the block contents in the form of aPacket. They avoid making a copy of the data.Vtsyncβ causes the server to flush all pending write requests to disk before returning.Vtpingβ executes a ping transaction with the server.
By default, vtread and vtreadpacket check that the SHA1 hash of the returned data matches the requested score, and vtwrite and vtwritepacket check that the returned score matches the SHA1 hash of the written data. Setting ventidoublechecksha1 to zero disables these extra checks, mainly for benchmarking purposes.
π¨ Doing so in production code is not recommended. Like, respectfully, don't. π
These functions can be called from multiple threads or procs simultaneously to issue requests in parallel. Programs that issue requests from multiple threads in the same proc should start separate procs running vtsendproc and vtrecvproc as described in venti-conn(3).
π¦ SOURCE π¦
/src/libventi
π SEE ALSO π
π DIAGNOSTICS π
Vtrpc and vtpacket return nil on error. The other routines return -1 on error.
Vtwrite returns 0 on success: there are no partial writes.
Okay that's the whole iconic page, bestie β signing off from VENTI-CLIENT(3), source /src/libventi, and the footer didn't hand us a date, just the title again. Stay slaying those Venti calls! π«Άβ¨
π¦ where this page comes from
- alpine 3.24: plan9port-doc 0_git20260208-r0 Β· LPL-1.02
- arch rolling: plan9port 20261021-2 Β· custom
- nixos 26.05: plan9port 0-unstable-2025-11-10
- nixos 26.05: plan9port-wayland 0-unstable-2025-11-26
- nixpkgs unstable: plan9port 0-unstable-2025-11-10
- nixpkgs unstable: plan9port-wayland 0-unstable-2025-11-26
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms