| posix_read#(FD, USER, ROOT, FS; BUF, N, ERR, OFH) {if N ≤ # BUF then {choose E with pre-read(FD, N, E, USER, ROOT, FS, OFH) in ERR := E; if ERR = ESUCCESS then let FH = OFH[FD] in let FDATA = FS[FH.fid] in choose N0 with N0 ≤ N ∧ FH.pos + N0 ≤ # FDATA.content in {N := N0; BUF := copy(FDATA.content, FH.pos, BUF, 0, N); OFH[FD].pos := FH.pos + N} ifnone N := 0 else N := ?} else abort } |