Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Sep 2006 09:40:13 +1000
From:      Mark Andrews <Mark_Andrews@isc.org>
To:        stable@freebsd.org
Subject:   Re: Is there any good reason for get*by*_r()? 
Message-ID:  <200609272340.k8RNeDWZ052971@drugs.dv.isc.org>
In-Reply-To: Your message of "Wed, 27 Sep 2006 16:44:16 EST." <20060927163639.F58991@thor.farley.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

> 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



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