nsdispatch - name-service switch dispatcher routine
Lb libc
retval
is passed to each method to modify as necessary, to pass back results to
the caller of
nsdispatch (.);
Each method has the function signature described by the typedef:
typedef int Fn *nss_method void *retval void *mdata va_list *ap ;
dtab is an array of ns_dtab structures, which have the following format:
typedef struct _ns_dtab { const char *src; nss_method method; void *mdata; } ns_dtab;
The Fa dtab array should consist of one entry for each source type that is implemented, with src as the name of the source, method as a function which handles that source, and mdata as a handle on arbitrary data to be passed to the method. The last entry in dtab should contain NULL values for src method and mdata
Additionally, methods may be implemented in NSS modules, in which case they are selected using the Fa database and Fa method_name arguments along with the configured source. (The methods supplied via Fa dtab take priority over those implemented in NSS modules in the event of a conflict.)
defaults contains a list of default sources to try if nsswitch.conf5 is missing or corrupted, or if there is no relevant entry for database It is an array of ns_src structures, which have the following format:
typedef struct _ns_src { const char *src; u_int32_t flags; } ns_src;
The Fa defaults array should consist of one entry for each source to be configured by default indicated by src and flags set to the criterion desired (usually NS_SUCCESS refer to Sx Method return values for more information). The last entry in defaults should have src set to NULL and flags set to 0.For convenience, a global variable defined as:
extern const ns_src __nsdefaultsrc[];exists which contains a single default entry for the source `files' that may be used by callers which do not require complicated default rules.
`... ' are optional extra arguments, which are passed to the appropriate method as a variable argument list of the type Vt va_list .
Refer to
nsswitch.conf5
for a complete description of what each source type is.
Refer to
nsswitch.conf5
for a complete description of each status code.
The
nsdispatch ();
function returns the value of the method that caused the dispatcher to
terminate, or
NS_NOTFOUND
otherwise.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |