title: What return value to use for `read()`?
body: <p>I've noticed that several times to check the return value of <code>read()</code> it's used the type <code>int</code>, but checking on <em>man</em> I noticed that <code>read()</code> returns a value of type <code>ssize_t</code> instead. <strike> I got that "in general" int is supposed to be bigger than ssize_t and that's why we don't occur in a error. But my question is: </strike> <strong>Is there a reason to use <code>int</code> instead of <code>ssize_t</code>?</strong> Shouldn't it be a best practice to use <code>ssize_t</code>?</p>
  
  <p>Example code:</p>
  
  <pre><code>int x;
  //ssiz_t x;
  x = read(fd, &amp;a, sizeof(a));
  if (x == sizeof(a))
      // all is fine
  if (x == -1)
      // Error while reading file
  if (x == 0)
      // Unexpected end of file
  </code></pre>