Go to the first, previous, next, last section, table of contents.


The Naming Scheme of the NSS Modules

The name of each function consist of various parts:

_nss_service_function

service of course corresponds to the name of the module this function is found in.(1) The function part is derived from the interface function in the C library itself. If the user calls the function gethostbyname and the service used is files the function

       _nss_files_gethostbyname_r

in the module

       libnss_files.so.1

is used. You see, what is explained above in not the whole truth. In fact the NSS modules only contain reentrant versions of the lookup functions. I.e., if the user would call the gethostbyname_r function this also would end in the above function. For all user interface functions the C library maps this call to a call to the reentrant function. For reentrant functions this is trivial since the interface is (nearly) the same. For the non-reentrant version The library keeps internal buffers which are used to replace the user supplied buffer.

I.e., the reentrant functions can have counterparts. No service module is forced to have functions for all databases and all kinds to access them. If a function is not available it is simply treated as if the function would return unavail (see section Actions in the NSS configuration).

The file name `libnss_files.so.1' would be on a Solaris 2 system `nss_files.so.1'. This is the difference mentioned above. Sun's NSS modules are usable as modules which get indirectly loaded only.

The NSS modules in the GNU C Library are prepared to be used as normal libraries itself. This is not true in the moment, though. But the different organization of the name space in the modules does not make it impossible like it is for Solaris. Now you can see why the modules are still libraries.(2)


Go to the first, previous, next, last section, table of contents.