Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Oct 2003 07:59:00 -0400
From:      Louis LeBlanc <freebsd@keyslapper.org>
To:        FreeBSD Questions <freebsd-questions@FreeBSD.org>
Subject:   Re: thread safety and host lookups
Message-ID:  <20031010115900.GA30788@keyslapper.org>
In-Reply-To: <20031010010535.GD10682@rot13.obsecurity.org>
References:  <20031009233104.GG54245@keyslapper.org> <20031010010535.GD10682@rot13.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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@keyslapper.org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     ԿԬ

Thyme's Law:
  Everything goes wrong at once.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031010115900.GA30788>