gethostbyname on local host returns for address

Juan Lang juan_lang at
Wed Aug 18 21:32:10 CDT 2004

Robert wrote:
> On windows gethostbyname for the local host returns
> the addresses of the available network interfaces.
> On wine and unix, it only returns the localhost
> Any ideas on how to get the windows behavior?

I assume you're referring to gethostname (as in your
sample code), not gethostbyname (as in your email).

Well, I guess you'd have to modify winsock/socket.c's
WS_gethostname function, maybe to call GetAdaptersInfo
or some such.  That'll get you the addresses, anyway. 
If you want a name other than localhost you may want
to call GetNetworkParams too.


Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

More information about the wine-devel mailing list