Subject: Re: gethostbyname & gethostbyaddr in libc thread-safe yet?
To: Alicia da Conceicao <alicia@engine.ca>
From: Christos Zoulas <christos@zoulas.com>
List: tech-net
Date: 05/26/2004 13:18:47
On May 26, 12:50pm, alicia@engine.ca (Alicia da Conceicao) wrote:
-- Subject: Re: gethostbyname & gethostbyaddr in libc thread-safe yet?

| > | When I have time, I will likely end up coding my own cross-platform, thread-
| > | safe DNS resolver client library from scratch, or if I am lazy, I will just
| > | rip out the tiny DNS resolver client from uClibc.
| 
| If I only do DNS resolving with "getaddrinfo" & "getnameinfo", would they
| be thread-safe in NetBSD-current, in that no one thread can block, clobber,
| or corrupt the data of another thread when they are both resolving DNS?
| Again, I am not using any YP or PWD directly in my code.

I added a test in /usr/src/regress/lib/libpthread/resolv/ that does exactly
that and it works. I believe that you are ok if you don't use YP.

christos