title: How to reset a socket back to blocking mode (after I set it to nonblocking mode)?
body: <p>I have read this regarding setting a socket to non-blocking mode.</p>
  
  <p><a href="http://www.gnu.org/software/libc/manual/html_mono/libc.html#File-Status-Flags" rel="noreferrer">http://www.gnu.org/software/libc/manual/html_mono/libc.html#File-Status-Flags</a></p>
  
  <p>Here is what I did:</p>
  
  <pre><code>static void setnonblocking(int sock)
  {
      int opts;
  
      opts = fcntl(sock,F_GETFL);
      if (opts &lt; 0) {
          perror("fcntl(F_GETFL)");
          exit(EXIT_FAILURE);
      }
      opts = (opts | O_NONBLOCK);
      if (fcntl(sock,F_SETFL,opts) &lt; 0) {
          perror("fcntl(F_SETFL)");
          exit(EXIT_FAILURE);
      }
      return;
  }
  </code></pre>
  
  <p>How can I set the socket back to Blocking mode? I don't see a O_BLOCK flag?</p>
  
  <p>Thank you.</p>