gethostbyname & uname question, help!

Corinna Vinschen
Fri Dec 29 02:36:00 GMT 2000

On Fri, Dec 29, 2000 at 11:03:48AM +0100, Corinna Vinschen wrote:
> On Fri, Dec 29, 2000 at 05:21:00PM +0800, crazyyao wrote:
> > Which head file should I include, winsock.h or sys/socket.h?
> > What's the differenc between them?
> Don't include the winsock headers by yourself when creating a
> Cygwin application.

I forgot the difference: winsock.h is the Windows specific
header. Windows uses an extra socket lib called Winsock which
is based on the BSD implementation with several incompatible
Windows additions.

Cygwin has it's own socket interface which tries to be
POSIX compatible. This implementation uses Winsock as it's

You will get in trouble when mixing both. Cygwin has it's
own `socket' call for example which uses the Winsock `socket'
call. However, they are not interchangable. You can't call
the Winsock `recv' with a Cygwin socket descriptor and vice versa.

You will find more information in the online docs under

Hope, that helps,

Want to unsubscribe from this list?
Check out:

More information about the Cygwin mailing list