From owner-freebsd-hackers Wed Apr 12 2: 4:50 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ada.eu.org (marvin.enst.fr [137.194.161.2]) by hub.freebsd.org (Postfix) with ESMTP id BA50837BB51 for ; Wed, 12 Apr 2000 02:04:43 -0700 (PDT) (envelope-from sam@inf.enst.fr) Received: from trillian.enst.fr (antinea.enst.fr [137.194.160.145]) by ada.eu.org (Postfix) with ESMTP id 4898919076; Wed, 12 Apr 2000 11:04:42 +0200 (CEST) Received: by trillian.enst.fr (Postfix, from userid 1000) id CE0792E; Wed, 12 Apr 2000 11:04:37 +0200 (CEST) Date: Wed, 12 Apr 2000 11:04:37 +0200 To: Ming Zhang Cc: freebsd-hackers@freebsd.org Subject: Re: Multithread safe gethostbyname() ? References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from ming@yahoo-inc.com on Tue, Apr 11, 2000 at 06:26:49PM -0700 From: Samuel Tardieu Organization: Ecole Nationale Superieure des Telecommunications Reply-To: Samuel Tardieu Content-Transfer-Encoding: 8bit X-WWW: http://www.inf.enst.fr/~tardieu/ X-Mail-Processing: Sam's procmail tools X-ICQ: 21547599 Message-Id: <2000-04-12-11-04-37+trackit+sam@inf.enst.fr> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 11/04, Ming Zhang wrote: | On Solaris there is gethostbyname_r(). Calling gethostbyname() with in | two threads cause both threads to block. gethostbyname_r exists, at least in 4.0, but is poorly implemented (it is in fact not thread safe). However, if you are using 4.0, you should consider using getipnodebyname(), which is MT-safe and more powerful than the old gethostbyX functions. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message