I/O trace practice
Predict before executing:
- Input abcdefg; results 3, 2, then EIO. What progress is returned and which bytes were accepted?
- The first call reports EINTR, then accepts 2. Which input pointer is used for the second call?
- A writer repeatedly returns EINTR with budget 4. How many calls occur?
- A writer returns zero with nonempty input. Why not continue forever?
- After a complete write, is a remote application known to have processed the input?
- Why does a duplicated pipe write end affect EOF?
Calibration
- Five bytes, abcde, and EIO. The accepted prefix cannot simply be undone.
- The original start; the interrupted negative result made no progress under this contract.
- Four, then BUDGET if input remains. This bounds attempts, not blocked time.
- Return a distinct stalled result; a generic busy loop has no progress guarantee.
- No. Completion here describes local acceptance only.
- EOF requires no remaining write-end references. Account for every owner/duplicate.
Repeat after a delay with a changed budget and chunk size. Explain when suffix retry is justified and when destination state is too uncertain.