-/* Write LEN bytes at PTR to descriptor DESC, retrying if interrupted.
- Return LEN upon success, write's (negative) error code otherwise. */
-
-int
-full_write (int desc, const char *ptr, size_t len)
+/* Write(read) COUNT bytes at BUF to(from) descriptor FD, retrying if
+ interrupted or if a partial write(read) occurs. Return the number
+ of bytes transferred.
+ When writing, set errno if fewer than COUNT bytes are written.
+ When reading, if fewer than COUNT bytes are read, you must examine
+ errno to distinguish failure from EOF (errno == 0). */
+size_t
+full_rw (int fd, const void *buf, size_t count)