Signals continued This gives us consistency, but it doesn't entirely solve the syscall restart problem Reads and writes may still return early Other syscalls aren't guaranteed to complete either It is still necessary to retry important calls on failure For read() and write() we use the atomicio() wrapper Automatically restarts reads or writes, updating buffer offset and transfer count Also returns size_t (unsigned), to make our code easier to rid of signed vs. unsigned bugs Downside: parts of the application block Makes turning ssh into a library more difficult