72 lines · 1.6 KB · Text
RawDownload
.TH FVERSION 2.SH NAMEfversion \- initialize 9P connection and negotiate version.SH SYNOPSIS.nf.PP.ft L#include <u.h>#include <libc.h>.PP.ft P.Bint   fversion(int fd, int bufsize, char *version, int nversion).SH DESCRIPTION.PP.I Fversionis used to initialize the 9P connection represented by.I fdand to negotiate the version of the protocol to be used..PPThe.I bufsizedetermines 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 versionis a text string that represents the highest version level the protocol will support.The.I versionwill be overwritten with the negotiated, possibly lower, version of the protocol.The return value of.I fversionis the length of the returned version string; the value of.I nversionis 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..PPDefault values of zero for.I bufsizeand the empty string for.I versionwill negotiate sensible defaults for the connection.If.I versionis the empty string,.I nversionmust still be large enough to receive the returned version string..PPThe interpretation of the version strings is defined in.IR version (5)..PPIt is rare to use.IR fversiondirectly; usually the default negotiation performedby 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 DIAGNOSTICSSets.IR errstr .