Subject: Re: NetBSD getaddrinfo not reentrant
To: None <>
From: Christos Zoulas <>
List: tech-net
Date: 05/03/2005 14:22:38
In article <>,
Bill Studenmund  <> wrote:
>On Tue, May 03, 2005 at 12:16:18PM -0000, wrote:
>> "We're now thinking it has to do with the fact that your platform has
>> no gethostbyname_r functions, and the getaddrinfo function on netbsd,
>> while claiming to be reentrant, actually isn't."
>The getaddrinfo manpage indicates that the current implementation is not 
>thread safe. This indication has been in the manpage since revision 1.
>> My questions:
>> 1) Do these statements make sense?
>> 2) Is this a known issue?
>> 3) Has this been addressed in the 3 branch?
>Yes, yes, and AFAIK no.

This is not entirely true. getaddrinfo() is re-entrant for dns queries
and service lookups. Java works fine with it, and there is a test in
regress/lib/libpthread/resolv.c that works. It is when you use NIS, and
other non-reentrant methods where it might break. In fact, reentrant
getaddrinfo was one of the prerequisits to get java working.