Skip to main content

I/O trace practice

Predict before executing:

  1. Input abcdefg; results 3, 2, then EIO. What progress is returned and which bytes were accepted?
  2. The first call reports EINTR, then accepts 2. Which input pointer is used for the second call?
  3. A writer repeatedly returns EINTR with budget 4. How many calls occur?
  4. A writer returns zero with nonempty input. Why not continue forever?
  5. After a complete write, is a remote application known to have processed the input?
  6. Why does a duplicated pipe write end affect EOF?

Calibration​

  1. Five bytes, abcde, and EIO. The accepted prefix cannot simply be undone.
  2. The original start; the interrupted negative result made no progress under this contract.
  3. Four, then BUDGET if input remains. This bounds attempts, not blocked time.
  4. Return a distinct stalled result; a generic busy loop has no progress guarantee.
  5. No. Completion here describes local acceptance only.
  6. 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.