title: When does the socket creation fails in C?
body: <p>I have to perform testing of socket related requirements for the software. As part of testing, I have to create a case for socket creation failure. My question is how do I make the C language socket() function return error value -1. The following are the lines of code to create the sockets in the software.</p>
  
  <pre><code>int socket = socket(AF_INET, SOCK_DGRAM, 0);
  </code></pre>
  
  <p>System configuration:</p>
  
  <ul>
  <li>OS: Windriver VxWorks</li>
  <li>Language: C</li>
  </ul>