From owner-freebsd-hackers Wed Apr 12 10:47:55 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from spirit.jaded.net (liv3-3.hamilton.idirect.com [209.161.208.3]) by hub.freebsd.org (Postfix) with ESMTP id 120D237C54C; Wed, 12 Apr 2000 10:40:38 -0700 (PDT) (envelope-from dan@spirit.jaded.net) Received: (from dan@localhost) by spirit.jaded.net (8.9.3/8.9.3) id NAA05646; Wed, 12 Apr 2000 13:41:59 -0400 (EDT) Date: Wed, 12 Apr 2000 13:41:58 -0400 From: Dan Moschuk To: John Baldwin Cc: ming@yahoo-inc.com, hackers@FreeBSD.ORG Subject: Re: Multithread safe gethostbyname() ? Message-ID: <20000412134158.A5630@spirit.jaded.net> References: <200004120538.WAA17491@sharmas.dhs.org> <200004121136.HAA32335@server.baldwin.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200004121136.HAA32335@server.baldwin.cx>; from jhb@FreeBSD.ORG on Wed, Apr 12, 2000 at 07:36:19AM -0400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG | > Is there a MT-safe implementation of gethostbyname() in FreeBSD (3.4/4.0)? | > | > On Solaris there is gethostbyname_r(). Calling gethostbyname() with in | > two threads cause both threads to block. | | No. :( Until we get one you can work around it by using a mutex around | calls to gethost* to allow only 1 thread to call them at a time. That won't work either, since, if I remember correctly, the returned struct hostent is static. -Dan -- Dan Moschuk (TFreak!dan@freebsd.org) "Waste not fresh tears on old griefs." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message