diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
| commit | 97d5c458cfa039d857301e1ca7d5af3beb37131d (patch) | |
| tree | b460cd850d0537eb71806ba30358840377b27688 /static/plan9-4e/man2/fversion.2 | |
| parent | b89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff) | |
build: Better Build System
Diffstat (limited to 'static/plan9-4e/man2/fversion.2')
| -rw-r--r-- | static/plan9-4e/man2/fversion.2 | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/static/plan9-4e/man2/fversion.2 b/static/plan9-4e/man2/fversion.2 new file mode 100644 index 00000000..711cca7b --- /dev/null +++ b/static/plan9-4e/man2/fversion.2 @@ -0,0 +1,72 @@ +.TH FVERSION 2 +.SH NAME +fversion \- initialize 9P connection and negotiate version +.SH SYNOPSIS +.nf +.PP +.ft L +#include <u.h> +#include <libc.h> +.PP +.ft P +.B +int fversion(int fd, int bufsize, char *version, int nversion) +.SH DESCRIPTION +.PP +.I Fversion +is used to initialize the 9P connection represented by +.I fd +and to negotiate the version of the protocol to be used. +.PP +The +.I bufsize +determines the size of the I/O buffer used to stage 9P requests to the server, +subject to the constraints of the server itself. +The +.I version +is a text string that represents the highest version level the protocol will support. +The +.I version +will be overwritten with the negotiated, possibly lower, version of the protocol. +The return value of +.I fversion +is the length of the returned version string; the value of +.I nversion +is therefore not the length of the version string presented to the system call, +but the total length of the buffer to accept the final result, in the manner of a read system call. +.PP +Default values of zero for +.I bufsize +and the empty string for +.I version +will negotiate sensible defaults for the connection. +If +.I version +is the empty string, +.I nversion +must still be large enough to receive the returned version string. +.PP +The interpretation of the version strings is defined in +.IR version (5). +.PP +It is rare to use +.IR fversion +directly; usually the default negotiation performed +by the kernel during +.B mount +(see +.IR bind (2)) +or even more commonly +.B amount +(see +.IR auth (2)) +is sufficient. +.SH SOURCE +.B /sys/src/libc/9syscall +.SH SEE ALSO +.IR intro (5), +.IR version (5), +.IR fauth (2). +.SH DIAGNOSTICS +Sets +.IR errstr . |
