gethostbyname on local host returns 127.0.0.1 for address
Juan Lang
juan_lang at yahoo.com
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
> 127.0.0.1.
>
> 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.
--Juan
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
More information about the wine-devel
mailing list