Lines Matching refs:mod
485 ns_mod mod;
488 memset(&mod, 0, sizeof(mod));
489 mod.name = strdup(source);
490 if (mod.name == NULL) {
498 mod.handle = nss_builtin_handle;
513 if (snprintf(buf, sizeof(buf), "nss_%s.so.%d", mod.name,
516 mod.handle = libc_dlopen(buf, RTLD_LOCAL|RTLD_LAZY);
517 if (mod.handle == NULL) {
522 nss_log(LOG_DEBUG, "%s, %s", mod.name, dlerror());
526 fn = (nss_module_register_fn)dlfunc(mod.handle,
529 (void)dlclose(mod.handle);
530 mod.handle = NULL;
531 nss_log(LOG_ERR, "%s, %s", mod.name, dlerror());
535 mod.mtab = fn(mod.name, &mod.mtabsize, &mod.unregister);
536 if (mod.mtab == NULL || mod.mtabsize == 0) {
537 if (mod.handle != nss_builtin_handle)
538 (void)dlclose(mod.handle);
539 mod.handle = NULL;
540 nss_log(LOG_ERR, "%s, registration failed", mod.name);
543 if (mod.mtabsize > 1)
544 qsort(mod.mtab, mod.mtabsize, sizeof(mod.mtab[0]),
547 _nsmod = vector_append(&mod, _nsmod, &_nsmodsize, sizeof(*_nsmod));
554 ns_mod_free(ns_mod *mod)
557 free(mod->name);
558 if (mod->handle == NULL)
560 if (mod->unregister != NULL)
561 mod->unregister(mod->mtab, mod->mtabsize);
562 if (mod->handle != nss_builtin_handle && !exiting)
563 (void)dlclose(mod->handle);
593 ns_mod *mod;
603 mod = vector_search(&source, _nsmod, _nsmodsize, sizeof(*_nsmod),
605 if (mod != NULL && mod->handle != NULL) {
608 match = bsearch(&key, mod->mtab, mod->mtabsize,
609 sizeof(mod->mtab[0]), mtab_compare);