From owner-freebsd-questions@FreeBSD.ORG Fri Oct 10 04:59:05 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FDD616A533 for ; Fri, 10 Oct 2003 04:59:05 -0700 (PDT) Received: from out012.verizon.net (out012pub.verizon.net [206.46.170.137]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4EFA43F85 for ; Fri, 10 Oct 2003 04:59:01 -0700 (PDT) (envelope-from leblanc@keyslapper.org) Received: from keyslapper.org ([151.199.62.62]) by out012.verizon.net (InterMail vM.5.01.05.33 201-253-122-126-133-20030313) with ESMTP id <20031010115901.NZJM20366.out012.verizon.net@keyslapper.org> for ; Fri, 10 Oct 2003 06:59:01 -0500 Received: from keyslapper.org (localhost [127.0.0.1]) by keyslapper.org (8.12.8p1/8.12.8) with ESMTP id h9ABx1up031053 for ; Fri, 10 Oct 2003 07:59:01 -0400 (EDT) (envelope-from leblanc@keyslapper.org) Received: (from leblanc@localhost) by keyslapper.org (8.12.8p1/8.12.8/Submit) id h9ABx0Na031050 for freebsd-questions@FreeBSD.org; Fri, 10 Oct 2003 07:59:00 -0400 (EDT) Date: Fri, 10 Oct 2003 07:59:00 -0400 From: Louis LeBlanc To: FreeBSD Questions Message-ID: <20031010115900.GA30788@keyslapper.org> Mail-Followup-To: FreeBSD Questions References: <20031009233104.GG54245@keyslapper.org> <20031010010535.GD10682@rot13.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20031010010535.GD10682@rot13.obsecurity.org> User-Agent: Mutt/1.5.4i X-Authentication-Info: Submitted using SMTP AUTH at out012.verizon.net from [151.199.62.62] at Fri, 10 Oct 2003 06:59:00 -0500 Subject: Re: thread safety and host lookups X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-questions@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Oct 2003 11:59:05 -0000 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.