| err = ESUCCESS, err0 = err1, f = fs[fh.fid], fh = ofh[fd], n0 = n, root.dir?, fids-cons(root, fs, ofh), pre-read(fd, n0, err, user, root, fs, ofh), fh.fid ∈ fs, fd ∈ ofh, n ≤ # buf ⊦ ⟪choose n with n ≤ n0 ∧ fh.pos + n ≤ # f.content in {n0 := n; buf := copy(f.content, fh.pos, buf, 0, n0); ofh[fd].pos := fh.pos + n0} ifnone n0 := 0⟫ fids-cons(root, fs, ofh) |
err = ESUCCESS, err0 = err1, f = fs[fh.fid], fh = ofh[fd], n0 = n1, root.dir?, fids-cons(root, fs, ofh), pre-read(fd, n0, err, user, root, fs, ofh), fd ∈ ofh, fh.fid ∈ fs, n ≤ n0, fh.pos + n ≤ # f.content, n1 ≤ # buf ⊦ ⟪n0 := n; buf := copy(f.content, fh.pos, buf, 0, n0); ofh[fd].pos := fh.pos + n0⟫ fids-cons(root, fs, ofh)
err = ESUCCESS, err0 = err1, f = fs[fh.fid], fh = ofh[fd], n0 = n, root.dir?, fids-cons(root, fs, ofh), pre-read(fd, n0, err, user, root, fs, ofh), fd ∈ ofh, fh.fid ∈ fs, n ≤ # buf, ∀ n. ¬(n ≤ n0 ∧ fh.pos + n ≤ # f.content) ⊦ ⟪n0 := 0⟫ fids-cons(root, fs, ofh)