title: Do all systems calls in C associate -1 as its error code?
body: <p>For example, <code>int fork</code> returns <code>-1</code> on error. <code>int pipe</code> also returns <code>-1</code> on error. <code>int socket</code> also returns <code>-1</code> on error.</p>
  
  <p>I want to know, do <code>all</code> system calls return <code>-1</code> on error. I've seen code with error checking, and it's all different. Some of them do <code>return value &lt; 0</code>, some of them do <code>return value == -1</code>, some of them do <code>return value &lt; 1</code>, and so, what can I do to error check <strong>any</strong> system call?</p>
  
  <p>What must I check? Or does it actually depend on the system call? Can I not always do <code>&lt; 0</code>?</p>