ssize_t ret;
while (len != 0 && (ret = read (fd, buf, len)) != 0) {
if (ret == -1) {
if (errno == EINTR)
continue;
perror ("read");
break;
}
len -= ret;
buf += ret;
}
I am wondering how this code can continue where it left off since If it receives an interrupt signal. In that case read() system call has to start again and doesn't it make it start from beginning? Same thing also valid for write() system call. Can you explain how these system call behave with those situations?