title: Using ssize_t vs int
body: <h2>Code</h2>
  
  <p>I've got a function which I can write in <em>one</em> of four possible ways:</p>
  
  <pre class="lang-c prettyprint-override"><code>    int do_or_die(int retval);
      int do_or_die(ssize_t retval);
      ssize_t do_or_die(int retval);   
      ssize_t do_or_die(ssize_t retval);   
  </code></pre>
  
  <hr>
  
  <p>And then it will be called with <em>both</em> of these ways for library functions:</p>
  
  <pre class="lang-c prettyprint-override"><code>    written = do_or_die(write(...)); // POSIX write returns ssize_t
      printed = do_or_die(printf(...)); // printf returns int
  </code></pre>
  
  <h2>Questions</h2>
  
  <ul>
  <li>Which prototype should I use?</li>
  <li>What types should I give to <code>written</code> and <code>printed</code>?</li>
  </ul>
  
  <p>I want to have the most robust and standard code, while still having just one <code>do_or_die</code> function.</p>
  
  <p>I am using C99 in this case, but if answer is different for C11, then I'd like to know that too, for future.</p>