From owner-freebsd-stable@FreeBSD.ORG Wed Sep 27 23:40:17 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5B3416A403 for ; Wed, 27 Sep 2006 23:40:17 +0000 (UTC) (envelope-from Mark_Andrews@isc.org) Received: from mx.isc.org (mx.isc.org [204.152.184.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 59C3F43D46 for ; Wed, 27 Sep 2006 23:40:17 +0000 (GMT) (envelope-from Mark_Andrews@isc.org) Received: from farside.isc.org (farside.isc.org [IPv6:2001:4f8:3:bb::5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "farside.isc.org", Issuer "ISC CA" (verified OK)) by mx.isc.org (Postfix) with ESMTP id 1623D114021 for ; Wed, 27 Sep 2006 23:40:17 +0000 (UTC) (envelope-from Mark_Andrews@isc.org) Received: from drugs.dv.isc.org (localhost.isc.org [IPv6:::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by farside.isc.org (Postfix) with ESMTP id 85AFCE6066 for ; Wed, 27 Sep 2006 23:40:16 +0000 (UTC) (envelope-from marka@isc.org) Received: from drugs.dv.isc.org (localhost [127.0.0.1]) by drugs.dv.isc.org (8.13.8/8.13.6) with ESMTP id k8RNeDWZ052971 for ; Thu, 28 Sep 2006 09:40:13 +1000 (EST) (envelope-from marka@drugs.dv.isc.org) Message-Id: <200609272340.k8RNeDWZ052971@drugs.dv.isc.org> To: stable@freebsd.org From: Mark Andrews In-reply-to: Your message of "Wed, 27 Sep 2006 16:44:16 EST." <20060927163639.F58991@thor.farley.org> Date: Thu, 28 Sep 2006 09:40:13 +1000 Sender: Mark_Andrews@isc.org Cc: Subject: Re: Is there any good reason for get*by*_r()? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Sep 2006 23:40:17 -0000 > On Tue, 26 Sep 2006, Mark Andrews wrote: > > > get*by*_r() are deprecated on most platforms and there use > > is highly non-portable, lots of different API's. > > My understanding was that FreeBSD has copied the Linux version of the > API. That still doesn't make it portable. > > Why are we adding compatability for deprecated functions? > > Some projects use them and do not consider get*by*() functions to be > thread-safe (FreeBSD's are). They would naturally impose extra locking > on the get*by*() calls for safety. devel/nspr which Firefox uses for > its network calls. I also saw that games/sauerbraten uses them. Of > course, these projects should replace these calls with getaddrinfo(). We should not be encouraging the use of deprecated API's. If a application is worried about being thread safe then it should use getaddrinfo() which has been thread safe from the begining. If getaddrinfo() is not available then protect gethostbyname() with locks if you can't determine if it is thread safe which it should be if the OS is keeping up with standards. Mark -- ISC Training! October 16-20, 2006, in the San Francisco Bay Area, covering topics from DNS to DHCP. Email training@isc.org. -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews@isc.org