[Imprint][Data Privacy Statement][E-Mail]

View long theorem info. View the proof. Back to main index. View the specification. View theorem base summary, View theorem base listing, the used properties by spec, the dependency list, the symbol table,

Theorem write-buf

wbuf_write_buf#(N, BUF, BUFLEB, PAGESIZE, PROOTADR, PMAXINO, PLOG, PLPT, PORPHANS; WBUF, ROFS, PVOL; ERR) {if BUFLEB ≠ nobuffer ∧ (¬ ROFS → WBUF.offset + WBUF.nbytes + N ≤ LEB_SIZE ∧ N ≤ # BUF) then if ROFS then ERR := EROFS else if WBUF.nbytes + N ≥ PAGESIZE then let N0 = align↓(WBUF.nbytes + N, PAGESIZE) in let N1 = N0 - WBUF.nbytes in let N2 = (WBUF.nbytes + N) % PAGESIZE in let BUF0 = mkbuf(N0) in {BUF0 := copy(WBUF.content, 0, BUF0, 0, WBUF.nbytes); BUF0 := copy(BUF, 0, BUF0, WBUF.nbytes, N1); apersistence_io_write#(BUFLEB.leb, WBUF.offset, 0, N0, BUF0, PROOTADR, PMAXINO, PLOG, PLPT, PORPHANS; PVOL; ERR); if ERR = ESUCCESS then {WBUF.content := copy(BUF, N1, WBUF.content, 0, N2); WBUF.offset := WBUF.offset + N0; WBUF.nbytes := N2} else ROFS := true} else {WBUF.content := copy(BUF, 0, WBUF.content, WBUF.nbytes, N); WBUF.nbytes := WBUF.nbytes + N; ERR := ESUCCESS} else abort }