Blame


1 fb1a36c0 2022-01-09 op .\" Copyright (c) 2021 Omar Polo <op@omarpolo.com>
2 fb1a36c0 2022-01-09 op .\"
3 fb1a36c0 2022-01-09 op .\" Permission to use, copy, modify, and distribute this software for any
4 fb1a36c0 2022-01-09 op .\" purpose with or without fee is hereby granted, provided that the above
5 fb1a36c0 2022-01-09 op .\" copyright notice and this permission notice appear in all copies.
6 fb1a36c0 2022-01-09 op .\"
7 fb1a36c0 2022-01-09 op .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 fb1a36c0 2022-01-09 op .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 fb1a36c0 2022-01-09 op .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10 fb1a36c0 2022-01-09 op .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 fb1a36c0 2022-01-09 op .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 fb1a36c0 2022-01-09 op .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13 fb1a36c0 2022-01-09 op .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14 fb1a36c0 2022-01-09 op .\"
15 fb1a36c0 2022-01-09 op .Dd $Mdocdate: July 30 2021 $
16 fb1a36c0 2022-01-09 op .Dt 9P 7
17 fb1a36c0 2022-01-09 op .Os
18 fb1a36c0 2022-01-09 op .Sh NAME
19 fb1a36c0 2022-01-09 op .Nm 9P
20 fb1a36c0 2022-01-09 op .Nd Simple Distributed File System
21 fb1a36c0 2022-01-09 op .Sh DESCRIPTION
22 fb1a36c0 2022-01-09 op .Nm
23 fb1a36c0 2022-01-09 op is a protocol that implements a distributed file systems.
24 fb1a36c0 2022-01-09 op It provides primitives to manage
25 fb1a36c0 2022-01-09 op .Pq create, read, write and delete
26 fb1a36c0 2022-01-09 op sets of files remotely.
27 fb1a36c0 2022-01-09 op These files don't necessarily need to be actually stored on a disk,
28 fb1a36c0 2022-01-09 op they may be, for example, synthesise on demand from external sources.
29 fb1a36c0 2022-01-09 op .Pp
30 fb1a36c0 2022-01-09 op A client transmits requests
31 fb1a36c0 2022-01-09 op .Pq T-messages
32 fb1a36c0 2022-01-09 op to a server, which returns replies
33 fb1a36c0 2022-01-09 op .Pq R-messages
34 fb1a36c0 2022-01-09 op to the client.
35 fb1a36c0 2022-01-09 op The combined acts of transmitting a request of a particular type and
36 fb1a36c0 2022-01-09 op receiving a reply is called a transaction of that type.
37 fb1a36c0 2022-01-09 op .Pp
38 fb1a36c0 2022-01-09 op Each message consists of a sequence of bytes mostly grouped in one,
39 fb1a36c0 2022-01-09 op two or four integer fields transmitted in little-endian order
40 fb1a36c0 2022-01-09 op .Pq least significant byte first .
41 fb1a36c0 2022-01-09 op Data items of larger or variable lengths are represented by a two-byte
42 fb1a36c0 2022-01-09 op field specifying the length followed by the actual data.
43 fb1a36c0 2022-01-09 op The only exception to this rule are QIDs, thirteen byte long
44 fb1a36c0 2022-01-09 op objects, that are sent as-is.
45 fb1a36c0 2022-01-09 op .Pp
46 fb1a36c0 2022-01-09 op Text strings are represented with a two-byte count and the sequence of
47 fb1a36c0 2022-01-09 op UNICODE codepoints encoded in UTF-8.
48 fb1a36c0 2022-01-09 op Text strings in 9p are not NUL-terminated.
49 fb1a36c0 2022-01-09 op The NUL-terminator is illegal in all text strings and thus excluded
50 fb1a36c0 2022-01-09 op from paths, user names and so on.
51 fb1a36c0 2022-01-09 op .Pp
52 fb1a36c0 2022-01-09 op Fields are hereafter denoted as
53 fb1a36c0 2022-01-09 op .Bd -literal -offset indent
54 fb1a36c0 2022-01-09 op type[1] tag[2] fid[4]
55 fb1a36c0 2022-01-09 op .Ed
56 fb1a36c0 2022-01-09 op .Pp
57 fb1a36c0 2022-01-09 op to indicate that type is one byte long, tag two and fid four.
58 fb1a36c0 2022-01-09 op Strings are denoted as name[s] and are sent on the wire as
59 fb1a36c0 2022-01-09 op .Bd -literal -offset indent
60 fb1a36c0 2022-01-09 op length[2] string[length]
61 fb1a36c0 2022-01-09 op .Ed
62 fb1a36c0 2022-01-09 op .Pp
63 fb1a36c0 2022-01-09 op A qid, described later, is a 13-byte value that is sent on the wire as
64 fb1a36c0 2022-01-09 op .Bd -literal -offset indent
65 fb1a36c0 2022-01-09 op type[1] version[4] path[8]
66 fb1a36c0 2022-01-09 op .Ed
67 fb1a36c0 2022-01-09 op .Sh MESSAGE STRUCTURE
68 fb1a36c0 2022-01-09 op Every message has a header with the following fields:
69 fb1a36c0 2022-01-09 op .Bd -literal -offset indent
70 fb1a36c0 2022-01-09 op len[4] type[1] tag[2]
71 fb1a36c0 2022-01-09 op .Ed
72 fb1a36c0 2022-01-09 op .Pp
73 fb1a36c0 2022-01-09 op where len indicates the overall length of the message, including
74 fb1a36c0 2022-01-09 op itself; type is one byte indicating the type of the message and the
75 fb1a36c0 2022-01-09 op tag is a number choosen by the client that indicate uniquely the
76 fb1a36c0 2022-01-09 op request.
77 fb1a36c0 2022-01-09 op Then follows an optional body whose structure depends on the type of
78 fb1a36c0 2022-01-09 op the message.
79 fb1a36c0 2022-01-09 op .Pp
80 fb1a36c0 2022-01-09 op The message types are as follows:
81 fb1a36c0 2022-01-09 op .Pq the header is omitted for brevity
82 fb1a36c0 2022-01-09 op .Bl -tag -width versionxx
83 fb1a36c0 2022-01-09 op .It Ic version
84 fb1a36c0 2022-01-09 op Negotiate the version and maximum message size.
85 fb1a36c0 2022-01-09 op .Bd -literal
86 fb1a36c0 2022-01-09 op msize[4] version[s]
87 fb1a36c0 2022-01-09 op msize[4] version[s]
88 fb1a36c0 2022-01-09 op .Ed
89 fb1a36c0 2022-01-09 op .Pp
90 fb1a36c0 2022-01-09 op The
91 fb1a36c0 2022-01-09 op .Ic version
92 fb1a36c0 2022-01-09 op request must be the first message sent, and the client cannot issue
93 fb1a36c0 2022-01-09 op further requests until receiving the Rversion reply.
94 fb1a36c0 2022-01-09 op .Cm tag
95 fb1a36c0 2022-01-09 op should be
96 fb1a36c0 2022-01-09 op .Dv NOTAG
97 fb1a36c0 2022-01-09 op .Pq \-1 or 255 .
98 fb1a36c0 2022-01-09 op The client suggest a
99 fb1a36c0 2022-01-09 op .Cm msize
100 fb1a36c0 2022-01-09 op .Pq the maximum size for packets
101 fb1a36c0 2022-01-09 op and the protocol version used, the server replies with a
102 fb1a36c0 2022-01-09 op .Cm msize
103 fb1a36c0 2022-01-09 op smaller or equal to the one proposed by the client.
104 fb1a36c0 2022-01-09 op The version string must always begin with the two character
105 fb1a36c0 2022-01-09 op .Dq 9P .
106 fb1a36c0 2022-01-09 op If the server don't understand the client required version, should
107 fb1a36c0 2022-01-09 op reply with a Rversion using the version string
108 fb1a36c0 2022-01-09 op .Dq unknown
109 fb1a36c0 2022-01-09 op and not use a Rerror.
110 fb1a36c0 2022-01-09 op .It Ic attach
111 fb1a36c0 2022-01-09 op Populate the namespace
112 fb1a36c0 2022-01-09 op .Bd -literal
113 fb1a36c0 2022-01-09 op fid[4] afid[4] uname[s] aname[s]
114 fb1a36c0 2022-01-09 op qid[13]
115 fb1a36c0 2022-01-09 op .Ed
116 fb1a36c0 2022-01-09 op .Pp
117 fb1a36c0 2022-01-09 op The
118 fb1a36c0 2022-01-09 op .Ic attach
119 fb1a36c0 2022-01-09 op message binds the given
120 fb1a36c0 2022-01-09 op .Ar fid
121 fb1a36c0 2022-01-09 op to the root of the file tree identified by
122 fb1a36c0 2022-01-09 op .Ar aname .
123 fb1a36c0 2022-01-09 op .Ar uname
124 fb1a36c0 2022-01-09 op identifies the user and
125 fb1a36c0 2022-01-09 op .Ar afid
126 fb1a36c0 2022-01-09 op specifies a fid previously established by an auth message, or the
127 fb1a36c0 2022-01-09 op special
128 fb1a36c0 2022-01-09 op .Dv NOFID
129 fb1a36c0 2022-01-09 op value
130 fb1a36c0 2022-01-09 op .Pq defined as (u32int)~0
131 fb1a36c0 2022-01-09 op if the authentication is not required.
132 fb1a36c0 2022-01-09 op .It Ic clunk
133 fb1a36c0 2022-01-09 op Close fids.
134 fb1a36c0 2022-01-09 op .Bd -literal
135 fb1a36c0 2022-01-09 op fid[4]
136 fb1a36c0 2022-01-09 op .Aq empty response
137 fb1a36c0 2022-01-09 op .Ed
138 fb1a36c0 2022-01-09 op .Pp
139 fb1a36c0 2022-01-09 op Once a fid has been clunked
140 fb1a36c0 2022-01-09 op .Pq closed
141 fb1a36c0 2022-01-09 op it becomes
142 fb1a36c0 2022-01-09 op .Dq free
143 fb1a36c0 2022-01-09 op and the same value can be used for subsequential
144 fb1a36c0 2022-01-09 op .Ic walk
145 fb1a36c0 2022-01-09 op or
146 fb1a36c0 2022-01-09 op .Ic attach
147 fb1a36c0 2022-01-09 op requests.
148 fb1a36c0 2022-01-09 op .Pp
149 fb1a36c0 2022-01-09 op The actual file on the disk is not remove unless it was opened with the
150 fb1a36c0 2022-01-09 op .Dv ORCLOSE
151 fb1a36c0 2022-01-09 op flag.
152 fb1a36c0 2022-01-09 op .It Ic error
153 fb1a36c0 2022-01-09 op Return an error string.
154 fb1a36c0 2022-01-09 op .Bd -literal
155 fb1a36c0 2022-01-09 op ename[s]
156 fb1a36c0 2022-01-09 op .Ed
157 fb1a36c0 2022-01-09 op .Pp
158 fb1a36c0 2022-01-09 op The Rerror message is used to return an error string describing the
159 fb1a36c0 2022-01-09 op failure of a request.
160 fb1a36c0 2022-01-09 op The
161 fb1a36c0 2022-01-09 op .Cm tag
162 fb1a36c0 2022-01-09 op indicates the failed request.
163 fb1a36c0 2022-01-09 op .Pp
164 fb1a36c0 2022-01-09 op Note that there isn't a
165 fb1a36c0 2022-01-09 op .Ic Terror
166 fb1a36c0 2022-01-09 op request for obvious reason and it's not possible for a server to reply to
167 fb1a36c0 2022-01-09 op a
168 fb1a36c0 2022-01-09 op .Ic Tversion
169 fb1a36c0 2022-01-09 op or
170 fb1a36c0 2022-01-09 op .Ic Tflush
171 fb1a36c0 2022-01-09 op using
172 fb1a36c0 2022-01-09 op .Ic Rerror .
173 fb1a36c0 2022-01-09 op .It Ic flush
174 fb1a36c0 2022-01-09 op Abort an ongoing operation.
175 fb1a36c0 2022-01-09 op .Bd -literal
176 fb1a36c0 2022-01-09 op oldtag[2]
177 fb1a36c0 2022-01-09 op .Aq empty response
178 fb1a36c0 2022-01-09 op .Ed
179 fb1a36c0 2022-01-09 op .Pp
180 fb1a36c0 2022-01-09 op Given the asynchronous nature of the protocol, the server may respond to
181 fb1a36c0 2022-01-09 op the pending request before responding to the
182 fb1a36c0 2022-01-09 op .Ic Tflush
183 fb1a36c0 2022-01-09 op and is possible for a client to send multiple
184 fb1a36c0 2022-01-09 op .Ic Tflush
185 fb1a36c0 2022-01-09 op for the same operation.
186 fb1a36c0 2022-01-09 op The client must wait to receive a corresponding
187 fb1a36c0 2022-01-09 op .Ic Rflush
188 fb1a36c0 2022-01-09 op before reusing
189 fb1a36c0 2022-01-09 op .Ar oldtag
190 fb1a36c0 2022-01-09 op for subsequent messages.
191 fb1a36c0 2022-01-09 op .Pp
192 fb1a36c0 2022-01-09 op If a response for
193 fb1a36c0 2022-01-09 op .Ar oldtag
194 fb1a36c0 2022-01-09 op is received before the
195 fb1a36c0 2022-01-09 op .Ic Rflush
196 fb1a36c0 2022-01-09 op reply, the client must assume that the operation was completed with success
197 fb1a36c0 2022-01-09 op .Pq fid allocated, files created, ...
198 fb1a36c0 2022-01-09 op If no response is received before the
199 fb1a36c0 2022-01-09 op .Ic Rflush
200 fb1a36c0 2022-01-09 op then the transaction is considered to have been successfully cancelled.
201 fb1a36c0 2022-01-09 op .Pp
202 fb1a36c0 2022-01-09 op Note that the tag of this request and the corresponding reply is NOT
203 fb1a36c0 2022-01-09 op .Ar oldtag
204 fb1a36c0 2022-01-09 op but a new tag value.
205 fb1a36c0 2022-01-09 op .It Ic walk
206 fb1a36c0 2022-01-09 op Traverse a file tree.
207 fb1a36c0 2022-01-09 op .Bd -literal
208 fb1a36c0 2022-01-09 op fid[4] newfid[4] nwname[2] nwname*(wname[s])
209 fb1a36c0 2022-01-09 op nwqid[2] nwqid*(qid[13])
210 fb1a36c0 2022-01-09 op .Ed
211 fb1a36c0 2022-01-09 op .Pp
212 fb1a36c0 2022-01-09 op The
213 fb1a36c0 2022-01-09 op .Ar nwname
214 fb1a36c0 2022-01-09 op components are walked in order starting from
215 fb1a36c0 2022-01-09 op .Ar fid
216 fb1a36c0 2022-01-09 op .Pq which must point to a directory
217 fb1a36c0 2022-01-09 op and, if successful,
218 fb1a36c0 2022-01-09 op .Ar newfid
219 fb1a36c0 2022-01-09 op is associated to the reached file.
220 fb1a36c0 2022-01-09 op .Pp
221 fb1a36c0 2022-01-09 op It is possible for
222 fb1a36c0 2022-01-09 op .Ar fid
223 fb1a36c0 2022-01-09 op and
224 fb1a36c0 2022-01-09 op .Ar newfid
225 fb1a36c0 2022-01-09 op to be equal, in this case the fid is
226 fb1a36c0 2022-01-09 op .Dq mutated ,
227 fb1a36c0 2022-01-09 op otherwise
228 fb1a36c0 2022-01-09 op .Ar newfid
229 fb1a36c0 2022-01-09 op must be unused.
230 fb1a36c0 2022-01-09 op As a special case, a walk of zero components duplicates the fid.
231 fb1a36c0 2022-01-09 op .Pp
232 fb1a36c0 2022-01-09 op If the first element cannot be walked for any reason an
233 fb1a36c0 2022-01-09 op .Ic Rerror
234 fb1a36c0 2022-01-09 op is returned.
235 fb1a36c0 2022-01-09 op Otherwise,
236 fb1a36c0 2022-01-09 op .Ic Rwalk
237 fb1a36c0 2022-01-09 op is returned with a number of qids equal to the file viside by the walk.
238 fb1a36c0 2022-01-09 op A client can thus detect a walk when that the replied
239 fb1a36c0 2022-01-09 op .Ar nwqid
240 fb1a36c0 2022-01-09 op number is not equal to the
241 fb1a36c0 2022-01-09 op .Ar nwname
242 fb1a36c0 2022-01-09 op field in the request.
243 fb1a36c0 2022-01-09 op Only when walk return successfully
244 fb1a36c0 2022-01-09 op .Ar newfid
245 fb1a36c0 2022-01-09 op will be affected.
246 fb1a36c0 2022-01-09 op .Pp
247 fb1a36c0 2022-01-09 op A maximum of 16 component can be used per walk request.
248 fb1a36c0 2022-01-09 op .It Ic open
249 fb1a36c0 2022-01-09 op Prepare a fid for I/O.
250 fb1a36c0 2022-01-09 op .Bd -literal
251 fb1a36c0 2022-01-09 op fid[4] mode[1]
252 fb1a36c0 2022-01-09 op qid[13] iounit[4]
253 fb1a36c0 2022-01-09 op .Ed
254 fb1a36c0 2022-01-09 op .Pp
255 fb1a36c0 2022-01-09 op .Ar mode
256 fb1a36c0 2022-01-09 op determines the type of I/O:
257 fb1a36c0 2022-01-09 op .Bl -tag -width Ds -offset indent -compact
258 fb1a36c0 2022-01-09 op .It 0 Dv OREAD
259 fb1a36c0 2022-01-09 op .It 1 Dv OWRITE
260 fb1a36c0 2022-01-09 op .It 2 Dv ORDWD
261 fb1a36c0 2022-01-09 op .It 3 Dv OEXEC
262 fb1a36c0 2022-01-09 op .El
263 fb1a36c0 2022-01-09 op .Pp
264 fb1a36c0 2022-01-09 op The returned
265 fb1a36c0 2022-01-09 op .Ar iounit
266 fb1a36c0 2022-01-09 op is the optimal blocksize for I/O.
267 fb1a36c0 2022-01-09 op .It Ic create
268 fb1a36c0 2022-01-09 op Create a file
269 fb1a36c0 2022-01-09 op .Bd -literal
270 fb1a36c0 2022-01-09 op fid[4] name[s] perm[4] mode[1]
271 fb1a36c0 2022-01-09 op qid[13] iounit[4]
272 fb1a36c0 2022-01-09 op .Ed
273 fb1a36c0 2022-01-09 op .Pp
274 fb1a36c0 2022-01-09 op The call attempts to create a file named
275 fb1a36c0 2022-01-09 op .Ar name
276 fb1a36c0 2022-01-09 op in the directory identified by
277 fb1a36c0 2022-01-09 op .Ar fid
278 fb1a36c0 2022-01-09 op according to
279 fb1a36c0 2022-01-09 op .Ar perm
280 fb1a36c0 2022-01-09 op and then to open it with
281 fb1a36c0 2022-01-09 op .Ar mode
282 fb1a36c0 2022-01-09 op into the given
283 fb1a36c0 2022-01-09 op .Ar fid .
284 fb1a36c0 2022-01-09 op .Pp
285 fb1a36c0 2022-01-09 op It is illegal to use an already opened
286 fb1a36c0 2022-01-09 op .Ar fid
287 fb1a36c0 2022-01-09 op or to attempt to create the
288 fb1a36c0 2022-01-09 op .Dq \&.
289 fb1a36c0 2022-01-09 op or
290 fb1a36c0 2022-01-09 op .Dq ..
291 fb1a36c0 2022-01-09 op entries.
292 fb1a36c0 2022-01-09 op .It Ic read
293 fb1a36c0 2022-01-09 op Read data at offset from file
294 fb1a36c0 2022-01-09 op .Bd -literal
295 fb1a36c0 2022-01-09 op fid[4] offset[8] count[4]
296 fb1a36c0 2022-01-09 op count[4] data[count]
297 fb1a36c0 2022-01-09 op .Ed
298 fb1a36c0 2022-01-09 op .Pp
299 fb1a36c0 2022-01-09 op .Ar fid
300 fb1a36c0 2022-01-09 op must have been prepared for I/O with a previous
301 fb1a36c0 2022-01-09 op .Ic open
302 fb1a36c0 2022-01-09 op call.
303 fb1a36c0 2022-01-09 op The returned
304 fb1a36c0 2022-01-09 op .Ar count
305 fb1a36c0 2022-01-09 op is zero when reaching end-of-file and may be lesser than what requested.
306 fb1a36c0 2022-01-09 op .Pp
307 fb1a36c0 2022-01-09 op Directories are a stream of stat structures, as described in
308 fb1a36c0 2022-01-09 op .Ic stat ,
309 fb1a36c0 2022-01-09 op and for them the read request message must have offset equal to zero or
310 fb1a36c0 2022-01-09 op the value of
311 fb1a36c0 2022-01-09 op .Ar offset
312 fb1a36c0 2022-01-09 op in the previous read on the directory plus the number of bytes returned
313 fb1a36c0 2022-01-09 op in the previous read.
314 fb1a36c0 2022-01-09 op Thus, is not possible to seek into directories except for rewinding.
315 fb1a36c0 2022-01-09 op .It Ic write
316 fb1a36c0 2022-01-09 op Write data at offset
317 fb1a36c0 2022-01-09 op .Bd -literal
318 fb1a36c0 2022-01-09 op fid[4] offset[8] count[4] data[count]
319 fb1a36c0 2022-01-09 op count[4]
320 fb1a36c0 2022-01-09 op .Ed
321 fb1a36c0 2022-01-09 op .It Ic stat
322 fb1a36c0 2022-01-09 op get file status
323 fb1a36c0 2022-01-09 op .Bd -literal
324 fb1a36c0 2022-01-09 op fid[4]
325 fb1a36c0 2022-01-09 op stat[n]
326 fb1a36c0 2022-01-09 op .Ed
327 fb1a36c0 2022-01-09 op .Pp
328 fb1a36c0 2022-01-09 op The stat structure is made by the following fields:
329 fb1a36c0 2022-01-09 op .Bl -tag -width twelveletters -compact
330 fb1a36c0 2022-01-09 op .It size[2]
331 fb1a36c0 2022-01-09 op total byte count of the following data
332 fb1a36c0 2022-01-09 op .It type[2]
333 fb1a36c0 2022-01-09 op for kernel use
334 fb1a36c0 2022-01-09 op .It dev[4]
335 fb1a36c0 2022-01-09 op for kernel use
336 fb1a36c0 2022-01-09 op .It qid[13]
337 fb1a36c0 2022-01-09 op server unique identifier of the file
338 fb1a36c0 2022-01-09 op .It mode[4]
339 fb1a36c0 2022-01-09 op permissions and flags
340 fb1a36c0 2022-01-09 op .It atime[4]
341 fb1a36c0 2022-01-09 op last access time
342 fb1a36c0 2022-01-09 op .It mtime[4]
343 fb1a36c0 2022-01-09 op last modification time
344 fb1a36c0 2022-01-09 op .It length[8]
345 fb1a36c0 2022-01-09 op length of file in bytes
346 fb1a36c0 2022-01-09 op .It name[s]
347 fb1a36c0 2022-01-09 op file name
348 fb1a36c0 2022-01-09 op (must be
349 fb1a36c0 2022-01-09 op .Dq /
350 fb1a36c0 2022-01-09 op if the file is the root directory of the server)
351 fb1a36c0 2022-01-09 op .It uid[s]
352 fb1a36c0 2022-01-09 op owner name
353 fb1a36c0 2022-01-09 op .It gid[s]
354 fb1a36c0 2022-01-09 op group name
355 fb1a36c0 2022-01-09 op .It muid[s]
356 fb1a36c0 2022-01-09 op name of the user who last modified the file.
357 fb1a36c0 2022-01-09 op .El
358 fb1a36c0 2022-01-09 op .It Ic remove
359 fb1a36c0 2022-01-09 op Remove a file
360 fb1a36c0 2022-01-09 op .Bd -literal
361 fb1a36c0 2022-01-09 op fid[4]
362 fb1a36c0 2022-01-09 op .Aq empty response
363 fb1a36c0 2022-01-09 op .Ed
364 fb1a36c0 2022-01-09 op .El
365 fb1a36c0 2022-01-09 op .\" .Sh 9P2000.L EXTENSIONS
366 fb1a36c0 2022-01-09 op .\" .Xr kamid 8
367 fb1a36c0 2022-01-09 op .\" supports also a subset of the
368 fb1a36c0 2022-01-09 op .\" .Sq 9P2000.L
369 fb1a36c0 2022-01-09 op .\" dialect.
370 fb1a36c0 2022-01-09 op .\" The supported messages are
371 fb1a36c0 2022-01-09 op .\" .Bl -tag -width readdir
372 fb1a36c0 2022-01-09 op .\" .It Ic readdir
373 fb1a36c0 2022-01-09 op .\" Read directory entries
374 fb1a36c0 2022-01-09 op .\" .Bd -literal
375 fb1a36c0 2022-01-09 op .\" fid[4] offset[8] count[4]
376 fb1a36c0 2022-01-09 op .\" count[4] data[count]
377 fb1a36c0 2022-01-09 op .\" .Ed
378 fb1a36c0 2022-01-09 op .\" .Pp
379 fb1a36c0 2022-01-09 op .\" Each directory entry is described by a variable-length record:
380 fb1a36c0 2022-01-09 op .\" .Ql qid[13] offset[8] type[1] name[s] .
381 fb1a36c0 2022-01-09 op .\" Offset is zero upon the first call.
382 fb1a36c0 2022-01-09 op .\" If the
383 fb1a36c0 2022-01-09 op .\" .Ar count
384 fb1a36c0 2022-01-09 op .\" field in the
385 fb1a36c0 2022-01-09 op .\" .Ic Rreaddir
386 fb1a36c0 2022-01-09 op .\" response is not zero then more data is available.
387 fb1a36c0 2022-01-09 op .\" .Pp
388 fb1a36c0 2022-01-09 op .\" .Ar count
389 fb1a36c0 2022-01-09 op .\" is allowed to be zero in the request.
390 fb1a36c0 2022-01-09 op .\" .El
391 fb1a36c0 2022-01-09 op .Sh SEE ALSO
392 fb1a36c0 2022-01-09 op .Xr utf8 7 ,
393 fb1a36c0 2022-01-09 op .Xr kamid 8