summaryrefslogtreecommitdiff
path: root/lib9p/9P2000.txt
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-02 20:29:01 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-02 20:29:01 -0600
commitba8f3ddba03ab93158c93f77ef98137e1dd6e8e9 (patch)
tree6a502f012e52d6186dccd05c659e7cddd3c4b73f /lib9p/9P2000.txt
parent48ec9be1eba930b06050262a1a651d794c31bc11 (diff)
lib9p: add O_* flags
Diffstat (limited to 'lib9p/9P2000.txt')
-rw-r--r--lib9p/9P2000.txt24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib9p/9P2000.txt b/lib9p/9P2000.txt
index d90175b..da9b223 100644
--- a/lib9p/9P2000.txt
+++ b/lib9p/9P2000.txt
@@ -52,8 +52,8 @@ bitfield qt 8
# of the type for a plain file."
FILE=0
-# uniQue IDentification - "two files on the same server hierarchy are
-# the same if and only if their qids are the same"
+# uni"Q"ue "ID"entification - "two files on the same server hierarchy
+# are the same if and only if their qids are the same"
#
# - "path" is a unique uint64_t that does most of the work in the
# above statement about files being the same if their QIDs are the
@@ -82,6 +82,22 @@ stat = "stat_size[2]"
"file_owner_gid[s]"
"file_last_modified_uid[s]"
+# "O"pen flags (flags to pass to Topen and Tcreate)
+bitfield o 8
+ 0/_rwx_0 # low bit of the 2-bit READ/WRITE/RDWR/EXEC enum
+ 1/_rwx_1 # high bit of the 2-bit READ/WRITE/RDWR/EXEC enum
+ #2/unused
+ #3/unused
+ 4/TRUNC
+ #5/unused
+ 6/RCLOSE # remove-on-close
+ #7/unused
+
+ READ = 0
+ WRITE = 1
+ RDWR = 2
+ EXEC = 3
+
# In the 9P protocol, each message has a type, and message types come
# in pairs (except "Rerror"); "T" and "R"; "T" messages are
# client->server requests, and "R" messages are server->client
@@ -99,9 +115,9 @@ stat = "stat_size[2]"
109/Rflush = ""
110/Twalk = "fid[4] newfid[4] nwname[2] nwname*(wname[s])"
111/Rwalk = "nwqid[2] nwqid*(wqid[qid])"
-112/Topen = "fid[4] mode[1]"
+112/Topen = "fid[4] mode[o]"
113/Ropen = "qid[qid] iounit[4]"
-114/Tcreate = "fid[4] name[s] perm[4] mode[1]"
+114/Tcreate = "fid[4] name[s] perm[4] mode[o]"
115/Rcreate = "qid[qid] iounit[4]"
116/Tread = "fid[4] offset[8] count[4]"
117/Rread = "data[d]" # for directories data is the sequence "cnt*(entries[stat])"