On Mar 25, 2012, at 11:06 PM, Brian Geffon <bri...@apache.org> wrote:

> Hi all,
> In an effort to get ATS to build on OpenBSD, I noticed that we're using
> gethostbyname_r and gethostbyaddr_r (see ink_inet.cc), according to the
> manpage both of these APIs are obsolete and getaddrinfo should be used
> (which is reentrant by default), I only noticed this because OpenBSD 5.0
> doesn't support them. What does everyone think about doing the following:
> 
> As a first step I will create a new function called ink_getaddrinfo().
> Next, I will rewrite ink_gethostbyname_r() and ink_gethostbyaddr_r() to
> wrap ink_getaddrinfo(), this will be tricky because I will need to manually
> create the hostent structs to not break existing code that uses
> ink_gethostbyname_r and inkgethostbyaddr_r, does that seem hacky? The nice
> thing about getaddrinfo is that it appears we will be able to get rid of
> several defines such as RENTRENT_GETHOSTBYNAME and GETHOSTBYNAME_R_GLIBC2
> since the API seems to be consistant across BSD, Linux, and Darwin, unless
> there is something i'm missing? Lastly, I will try to switch all usages of
> ink_gethostbyname/addr_r over to the new ink_getaddrinfo(), at which point
> I will remove them entirely.

+1 this sounds good

J

Reply via email to