title: Can a read() or write() system call continue where it left off after being interrupted by an EINTR signal?
body: <pre><code>ssize_t ret;
  while (len != 0 &amp;&amp; (ret = read (fd, buf, len)) != 0) {
    if (ret == -1) {
      if (errno == EINTR)
        continue;
      perror (&quot;read&quot;);
      break;
    }
    len -= ret;
    buf += ret;
  }
  </code></pre>
  <p>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?</p>