66 lines · 1.2 KB · Text
RawDownload
.TH FAUTH 2.SH NAMEfauth \- set up authentication on a file descriptor to a file server.SH SYNOPSIS.nf.PP.ft L#include <u.h>#include <libc.h>.PP.ft P.Bint   fauth(int fd, char *aname).SH DESCRIPTION.PP.I Fauthis used to establish authentication for the current user to accessthe resources available through the 9P connection represented by.IR fd .The return value is a file descriptor, conventionally called.BR afd ,that is subsequently used to negotiate the authentication protocolfor the server, typically using.IR auth_proxyor.IR fauth_proxy(see.IR auth (2)).After successful authentication,.B afdmay be passed as the second argument to a subsequent.B mountcall (see.IR bind (2)),with the same.IR aname,as a ticket-of-entry for the user..PPIf.I fauthreturns -1, the error case, that means the file server does not requireauthentication for the connection, and.B afdshould be set to -1in the call to.BR mount..PPIt is rare to use.IR fauthdirectly; more commonly.I amount(see.IR auth (2))is used..SH SOURCE.B /sys/src/libc/9syscall.SH SEE ALSO.IR attach (5),.IR auth (2)(particularly.BR amount ),.IR authsrv (6),.IR auth (8).SH DIAGNOSTICSSets.IR errstr .