size_t done = 0;
while (done < count) {
ssize_t part_res = read(fd, buf+done, count-done);
+ if (part_res == -1 && errno == EINTR) continue;
if (part_res <= 0) {
if (last_res) *last_res = part_res;
if (done) return done;
size_t done = 0;
while (done < count) {
ssize_t part_res = write(fd, buf+done, count-done);
+ if (part_res == -1 && errno == EINTR) continue;
if (part_res <= 0) {
if (last_res) *last_res = part_res;
if (done) return done;