title: Sockets in MinGW
body: <p>I was just trying to build netcat in MSYS using MinGW and realized that MinGW never really ported all of the BSD socket stuff to Windows (eg sys/socket.h).  I know you can use Windows Sockets in MinGW, but why did they never make a Windows port of the BSD sockets?  I noticed quite a few programs using #ifdef's to workaround the issue.  Is there a Windows port of the BSD sockets somewhere that can be used instead?</p>
  
  <p>Here are the errors when doing a make for netcat in MSYS:</p>
  
  <pre><code>
  gcc -DLOCALEDIR=\"\/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -c `test -f 'core.c' || echo './'`core.c
  In file included from core.c:29:
  netcat.h:38:24: sys/socket.h: No such file or directory
  netcat.h:39:63: sys/uio.h: No such file or directory
  netcat.h:41:24: netinet/in.h: No such file or directory
  netcat.h:42:55: arpa/inet.h: No such file or directory
  </code>
  </pre>
  
  <p>There are no #ifdef's for MinGW.  Is there a library/package I can add to MSYS to make everything compile without errors?</p>
  
  <p>Note:  You can download netcat <a href="http://netcat.sourceforge.net/download.php" rel="noreferrer">here</a> and browse the CVS repo <a href="http://netcat.cvs.sourceforge.net/netcat/netcat/" rel="noreferrer">here</a></p>