This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gethostbyname & uname question, help!


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
base.

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
http://www.cygwin.com/docs.html

Hope, that helps,
Corinna

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]