-ssize_t retry_write(int fd, const void *buf, size_t count)
-{
- int Res;
- ssize_t i = 0;
- errno = 0;
- do
- {
- Res = write(fd, buf, count);
- if (Res < 0 && errno == EINTR)
- continue;
- if (Res < 0)
- break;
- buf = (char *)buf + Res;
- count -= Res;
- i += Res;
- }
- while (Res > 0 && count > 0);
- return i;
-}