thread safety and host lookups

Louis LeBlanc freebsd at keyslapper.org
Fri Oct 10 04:59:05 PDT 2003


On 10/09/03 06:05 PM, Kris Kennaway sat at the `puter and typed:
> On Thu, Oct 09, 2003 at 07:31:05PM -0400, Louis LeBlanc wrote:
> > Hey folks.  I'm working on a port from Solaris to FreeBSD.  For the
> > most part, things are pretty straightforward, but I can't seem to find
> > the details on thread safety for some system calls.
> > 
> > gethostbyname_r() is the thread safe call that replaces
> > gethostbyname() on Solaris.
> > 
> > Is there a similar alternative call in FreeBSD, or was the default
> > system call modified to ensure thread safety?
> 
> Unfortunately FreeBSD does not support gethostbyname_r() at this time.
> However, it looks like bind9 has an implementation.

Hmm.  I knew I shoulda brought my Stevens book home.  I noticed in the
manpage that gethostbyname() requires the standard c lib (-lc), but
the process builds and links fine with the re-entrant c lib (-lc_r).

I'm pretty sure that doesn't fix the problem.  I looked at the
re-entrant details of gethostbyname_r() some time ago, but can't
remember the specifics since I haven't dealt with it for some time.

I'll look at the bind9 stuff.

Thanks.

L
-- 
Louis LeBlanc               leblanc at keyslapper.org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     Ô¿Ô¬

Thyme's Law:
  Everything goes wrong at once.


More information about the freebsd-questions mailing list