Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Apr 2005 20:03:47 -0400
From:      David Schultz <das@FreeBSD.ORG>
To:        Hajimu UMEMOTO <ume@FreeBSD.ORG>
Cc:        cvs-src@FreeBSD.ORG
Subject:   Re: cvs commit: src/lib/libc/net getproto.c getprotoent.c getprotoname.c netdb_private.h
Message-ID:  <20050421000347.GA44160@VARK.MIT.EDU>
In-Reply-To: <yge1x95onco.wl%ume@mahoroba.org>
References:  <ygeu0m2zim9.wl%ume@mahoroba.org> <Pine.GSO.4.43.0504191516330.6115-100000@sea.ntplx.net> <ygesm1mzhol.wl%ume@mahoroba.org> <16997.30227.769989.36407@khavrinen.csail.mit.edu> <yge1x95onco.wl%ume@mahoroba.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 20, 2005, Hajimu UMEMOTO wrote:
> Hi,
> 
> >>>>> On Tue, 19 Apr 2005 17:20:19 -0400
> >>>>> Garrett Wollman <wollman@csail.mit.edu> said:
> 
> wollman> If they are generally useful they should be globally visible, with the
> wollman> standard FreeBSD namespace protections.  (In this case, this probably
> wollman> means that the __ versions stay as they are, and non-__ versions can
> wollman> be defined using aliases in a separate compilation unit.)
> 
> I'm not sure they are really useful.  I think they are preffered to
> use for thread applications.  However, our get{serv,proto}*() is now
> thread-safe.  So, we don't need to use get{serv,proto}*_r() to have
> just thread-safeness.
> 
> Indeed, I started this work to call getservby*_r() from getaddrinfo()
> and getnameinfo().  But, after all, I didn't modify getaddrinfo() and
> getnameinfo() to call getservby*_r() directly.
> 
> Further, getserv*_r() takes struct servent_data for its argument.  So,
> once we decide to expose them, we will need to pay attention to an ABI
> compatibility in the future.  So, we should be careful, IMHO.

If they are stable, and if applications (even ones written for
other platforms) might benefit from them, then the right way to
support them is as follows:

In foo.c:

	#include <sys/cdefs.h>

	type
	__foo(params)
	{
		body;
	}

	__weak_reference(__foo, foo);

In foo.h:

	#include <sys/cdefs.h>

	#if __BSD_VISIBLE
	type foo(params);
	#endif	/* __BSD_VISIBLE */

But this assumes the ABI is stable.  If this is not the case, then
they should not be exported, at least not immediately.



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