This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Where is gethostbyname2 ?
OK, thanks. The local declaration works just fine :)
On Sun, Jul 10, 2011 at 3:25 PM, Corinna Vinschen wrote:
> On Jul 10 03:19, Sam Mani wrote:
>> What header should a C file include to be able to call gethostbyname2() ?
>
> In theory that would be netdb.h, but apparently we forgot to declare
> the function there and nobody missed it so far. ?I applied a patch to
> CVS so the declaration will be added to the next Cygwin release.
>
> For the time being, just declare the function in your source file, in
> C++ for instance:
>
> ?extern "C" struct hostent *gethostbyname2 (const char *, int);
>
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple