title: Odd socket() error -- returns -1, but errno=ERROR_SUCCESS
body: <p>I'm developing a dedicated game server on a linux machine, in C/C++ (mixed). I have the following snippet of code:</p>
  
  <pre><code>int sockfd=socket(AI_INET, SOCK_DGRAM, 0);
  if(sockfd==-1)
  {
      int err=errno;
      fprintf(stderr,"%s",strerror(err));
      exit(1);
  }
  </code></pre>
  
  <p>My problem here, is that socket is returning -1 (implying a failure) and the error string is being printed, but it is "Success" (ERROR_SUCCESS).</p>
  
  <p>Other notes:</p>
  
  <ul>
  <li>I am requesting a socket on a port >1024 (out of context, but thought I'd mention)</li>
  <li>I'm executing the app as the super user</li>
  </ul>