Subject: Re: dynamically loadable nsdispatch callback functions
To: None <netbsd-help@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: netbsd-help
Date: 04/08/2002 11:58:00
On Mon, Apr 08, 2002 at 11:31:22AM +1000, Luke Mewburn wrote:
> On Sat, Apr 06, 2002 at 08:46:51PM -0800, collver@linuxfreemail.com wrote:
>   | Hello,
>   | 
>   | >bash-2.05$ man nsdispatch | tail -6
>   | >     Currently there is no support for dynamically loadable
>   | >     dispatcher call- back functions. It is anticipated that this
>   | >     will be added in the future in the back-end without requiring
>   | >     changes to code that invokes nsdispatch().
>   | >
>   | >NetBSD 1.5.2                   January 19, 1999                      2
>   | 
>   | Would it be difficult to add support for dynamically loadable dispatcher
>   | callback functions?
> 
> I've investigated this.  The simplest implementation method, using
> dlopen() from within the nsswitch routines in libc, requires that
> an application is dynamically linked.  Not all user-invoked tools
> are dynamically linked at the moment (/bin, /sbin, parts of other
> directories)

IIRC Solaris and SVR4 both allow 'statically' linked binaries to
dlopen() libraries - although you do need to specify -ldl when
building them.  In particular the password functions would dlopen()
libnsl.so (and then the name to address libraries) in order to
use NIS (et al).

In fact these 'static' programs were probably 'dynamic' but were
linked with the archive libc - so didn't actually need any shared
libraries.

	David

-- 
David Laight: david@l8s.co.uk