commit - d0226c8550ec9722699542fd3c69d1bf3323186d
commit + 92f79c8824274be4d1ed0e781e902e32e357eaee
blob - 3a36e6056c03bf9efa1b4ac5626ea4cfb65283db
blob + 31ce78e686426a0858cebfe43e09352252269309
--- kamid/9p.7
+++ kamid/9p.7
.It Ic error
Return an error string.
.Bd -literal
+.Aq no request
ename[s]
.Ed
.Pp
.Ar mode
determines the type of I/O:
.Bl -tag -width Ds -offset indent -compact
-.It 0 Dv OREAD
-.It 1 Dv OWRITE
-.It 2 Dv ORDWD
-.It 3 Dv OEXEC
+.It 0x00 Pq Dv OREAD
+Open the file for reading.
+.It 0x01 Pq Dv OWRITE
+Open the file for writing.
+.It 0x02 Pq Dv ORDWD
+Open the file for both reading and writing.
+.It 0x03 Pq Dv OEXEC
+Open for exec.
+.El
+.Pp
+Additionally, the following flags can be or'ed to
+.Ar mode :
+.Bl -tag -width Ds -offset indent -compact
+.It 0x10 Pq Dv OTRUNC
+Truncate the file before opening
+.It 0x40 Pq Dv ORCLOSE
+Remove the file upon
+.Ic clunk .
.El
.Pp
The returned
is the amount of data actually written and may differ from the one in
the request.
.It Ic stat
-get file status
+Get file status
.Bd -literal
fid[4]
stat[n]
While it may be considered redundant, it's kept to simplify the
parsing of the stat entries in a directory.
.It Ic wstat
-change file attributes
+Change file attributes
.Bd -literal
fid[4] stat[n]
.Aq empty response
.Ed
.Pp
+.Ar fid
+must have been prepared for writing with a previous
+.Ic open
+or
+.Ic create
+call.
+.Pp
The
.Ar stat
structure is the same described in