Blob
- Date:
- Message:
- Topen implemented Implement Topen plus some basic testing. ORCLOSE (remove file when the fid is clunked) is mapped to O_CLOEXEC and tried to be honoured on fid_free. "vanilla" 9P2000 uses reads on directories to list the entries while 9P2000.L (and .U too possibly) introduces an explicit Treaddir. I'm planning to support 9P2000-style read-on-dir but not yet.
- Actions:
- History | Blame | Raw File
1 include "consts.9ps"3 # 9p protocol5 proc version(msize, version) {6 send(Tversion, notag, msize:u32, version:str)7 }9 proc attach(fid, afid, uname, aname) {10 send(Tattach, iota(), fid:u32, afid:u32, uname:str, aname:str)11 }13 proc walk(fid, newfid, ...) {14 send(Twalk, iota(), fid:u32, newfid:u32, vargs:u16, ...)15 }17 proc open(fid, mode) {18 send(Topen, iota(), fid:u32, mode:u8)19 }21 proc clunk(fid) {22 send(Tclunk, iota(), fid:u32)23 }27 # useful functions29 proc mount(fid, path) {30 version(msize, np2000)32 m = recv()33 assert (34 m.type == Rversion35 m.tag == notag36 m.msize == msize37 # m.version == version38 )40 attach(fid, nofid, "op", path)42 m = recv()43 assert (44 m.type == Rattach45 m.qid.type == QTDIR46 )47 }49 proc walk-ok() {50 m = recv()51 assert m.type == Rwalk52 }54 proc expect-error() {55 m = recv()56 assert m.type == Rerror57 debug("got expected error", m)58 }