OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Jochen Schäfer on June 17, 2017, 11:11:09 am

Title: Where is getaddrinfo?
Post by: Jochen Schäfer on June 17, 2017, 11:11:09 am
Hi.

Does some know whether we have a implementation of getaddrinfo?
It seems to me that it should belong to the C standard library, but I can't find any declaration in /usr/include.
Title: Re: Where is getaddrinfo?
Post by: Paul Smedley on June 17, 2017, 11:29:31 am
Hi Jochen,

There are a few implementations around - for eg from Samba https://trac.netlabs.org/samba/browser/trunk/server/lib/replace/getaddrinfo.c & https://trac.netlabs.org/samba/browser/trunk/server/lib/replace/getaddrinfo.h

I've also opened a ticket for libcx to get this added.

Cheers,

Paul
Title: Re: Where is getaddrinfo?
Post by: Jochen Schäfer on June 17, 2017, 02:13:32 pm
Thank you, I will try the files.
Title: Re: Where is getaddrinfo?
Post by: Jochen Schäfer on June 17, 2017, 03:10:21 pm
Ok, the implementation has a lot depencies.
Then I have to wait until it gets into libcx.
Title: Re: Where is getaddrinfo?
Post by: Paul Smedley on June 17, 2017, 11:34:28 pm
Hey Jochen,

Ok, the implementation has a lot depencies.
Then I have to wait until it gets into libcx.

An alternative is from lwres from bind.

I've bundled up (hopefully) the necessary files in http://smedley.id.au/tmp/lwres.zip

#include <lwres/lwres.h> & maybe
#include <lwres/netdb.h>

and add -llwres to the linking line

Cheers,

Paul
Title: Re: Where is getaddrinfo?
Post by: Jochen Schäfer on June 18, 2017, 12:05:37 pm
The Bind implementation compiles (I couldn't test linking yet, since I'm running into other problems.
For that I installed the bind-devel package via yum and refenced their files.

Thanks again, Paul.