Manual Reference Pages - 9P-FID (3)
Fid, Fidpool, allocfidpool, freefidpool, allocfid, closefid, lookupfid, removefid,
Req, Reqpool, allocreqpool, freereqpool, allocreq, closereq, lookupreq, removereq - 9P fid, request tracking
typedef struct Fid
char omode; /* -1 if not open */
typedef struct Req
void freefidpool(Fidpool *p)
Fid* allocfid(Fidpool *p, ulong fid)
Fid* lookupfid(Fidpool *p, ulong fid)
void closefid(Fid *f)
void removefid(Fid *f)
void freereqpool(Reqpool *p)
Req* allocreq(Reqpool *p, ulong tag)
Req* lookupreq(Reqpool *p, ulong tag)
void closereq(Req *f)
void removereq(Req *r)
These routines provide management of
Req structures from
Reqpools. They are primarily used by the 9P server loop
Fid structures are intended to represent
active fids in a 9P connection, as
Chan structures do in the Plan 9 kernel.
fid element is the integer fid used in the 9P
Omode is the mode under which the fid was opened, or
-1 if this fid has not been opened yet.
Note that in addition to the values
omode can contain the various flags permissible in
an open call.
To ignore the flags, use
Omode should not be changed by the client.
The fid derives from a successful authentication by
Qid contains the qid returned in the last successful
create transaction involving the fid.
In a file tree-based server, the
file element points at a
corresponding to the fid.
aux member is intended for use by the
client to hold information specific to a particular
Fid. With the exception of
aux, these elements should be treated
as read-only by the client.
Allocfidpool creates a new
Freefidpool destroys such a pool.
Allocfid returns a new
Fid whose fid number is
fid. There must not already be an extant
Fid with that number in the pool.
Fid has been allocated, it can be looked up by
fid number using
Fids are reference counted: both
lookupfid increment the reference count on the
Fid structure before
When a reference to a
Fid is no longer needed,
closefid should be called to note the destruction of the reference.
When the last reference to a
Fid is removed, if
destroy (supplied when creating the fid pool)
is not zero, it is called with the
Fid as a parameter.
It should perform whatever cleanup is necessary
Removefid is equivalent to
closefid but also removes the
Fid from the pool.
Note that due to lingering references,
the return of
removefid may not mean that
destroy has been called.
removereq are analogous but
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.