public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gethostbyname & uname question, help!
@ 2000-12-29  1:19 crazyyao
  2000-12-29  2:04 ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: crazyyao @ 2000-12-29  1:19 UTC (permalink / raw)
  To: cygwin

I am a green hand in cygwin programming.
Would someone tell me how to get the network program compiled on cygwin?

I can't find which lib contains the function "uname" and
the function "gethostbyname" can't return the right value, either.

Which head file should I include, winsock.h or sys/socket.h?
What's the differenc between them?

Which libs should I use? Where are they?

I used to work on Linux.


Thanks very much.


&

Happy New Year to  EVERYONE!


crazyyao
RDCPS, Institue of Software, Beijing , China

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gethostbyname & uname question, help!
  2000-12-29  1:19 gethostbyname & uname question, help! crazyyao
@ 2000-12-29  2:04 ` Corinna Vinschen
  2000-12-29  2:36   ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2000-12-29  2:04 UTC (permalink / raw)
  To: cygwin

On Fri, Dec 29, 2000 at 05:21:00PM +0800, crazyyao wrote:
> I am a green hand in cygwin programming.
> Would someone tell me how to get the network program compiled on cygwin?
> 
> I can't find which lib contains the function "uname" and
> the function "gethostbyname" can't return the right value, either.

I don't understand. Both functions are part of the standard
library and are linked in without giving any additional lib
when linking. gethostbynmae returns what Winsock returns
except the given name is a x.x.x.x address in which case
this address is returned.

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

> Which libs should I use?

libcygwin.a which is linked in by default. No commandline switch
necessary.

> Where are they?

/lib

> I used to work on Linux.

Congratulations.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gethostbyname & uname question, help!
  2000-12-29  2:04 ` Corinna Vinschen
@ 2000-12-29  2:36   ` Corinna Vinschen
  0 siblings, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2000-12-29  2:36 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-12-29  2:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-29  1:19 gethostbyname & uname question, help! crazyyao
2000-12-29  2:04 ` Corinna Vinschen
2000-12-29  2:36   ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).