title: read() system call doesn't fail when an alarm signal is received
body: <p>This is (part of) my server-side code</p>
  
  <pre><code>void timeout_handler(int value) {
      printf("Handler\n");
      return;
  }
  
  int main (int argc, char **argv) {
      [...]
      signal(SIGALRM, timeout_handler);
      alarm(seconds);
      int result = read(input_socket, buffer, sizeof(buffer));
      if (result == -1 &amp;&amp; errno == EINTR) {
          printf("read() failed\n");
      }
      [...]
  }
  </code></pre>
  
  <p>where <code>input_socket</code> is a TCP socket correctly connected with a client (if I send data from the client, the server receives them).</p>
  
  <p>As a test of the alarm signal, I tried just to open and connect the socket client-side without send any data.
  I would expect an output like</p>
  
  <pre><code>Handler
  read() failed
  </code></pre>
  
  <p>but the result is only the <code>Handler</code> message, and then the process is still active.</p>
  
  <p>Why the <code>read()</code> doesn't fail with <code>errno=EINTR</code>?</p>