[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (x)gethostname
From: |
Simon Josefsson |
Subject: |
Re: (x)gethostname |
Date: |
Thu, 24 Jan 2008 17:05:02 +0100 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux) |
Bruno Haible <address@hidden> writes:
>> > And it is necessary to still override the function, in order to
>> > WSAStartup before?
>>
>> No, this doesn't seem to be necessary, at least under Wine.
>
> I don't think that you can judge the behaviour of Windows by testing on
> Wine. You know that Wine reimplements every DLL, so in particular Wine's
> winsock is a different implementation that Windows winsock.
I checked real Windows behaviour here, and it does indeed require that
WSAStartup is called before gethostname. Otherwise, gethostname will
return -1 and doesn't populate the buffer. So the gethostname
replacement module needs to call WSAStartup somehow.
I'll post an updated patch that uses the sockets module shortly.
/Simon
Re: (x)gethostname, Simon Josefsson, 2008/01/17