1 libkmod - linux kernel module handling library
6 libkmod was created to allow programs to easily insert, remove and
7 list modules, also checking its properties, dependencies and aliases.
9 there is no shared/global context information and it can be used by
10 multiple sites on a single program, also being able to be used from
11 threads, although it's not thread safe (you must lock explicitly).
17 Every user should create and manage it's own library context with:
19 struct kmod_ctx *ctx = kmod_new(kernel_dirname);
23 Modules can be created with by various means:
25 struct kmod_module *mod;
28 err = kmod_module_new_from_path(ctx, path, &mod);
33 kmod_module_unref(mod);
36 err = kmod_module_new_from_name(ctx, name, &mod);
41 kmod_module_unref(mod);
45 Or could be resolved from a known alias to a list of alternatives:
47 struct kmod_list *list, *itr;
49 err = kmod_module_new_from_lookup(ctx, alias, &list);
53 kmod_list_foreach(itr, list) {
54 struct kmod_module *mod = kmod_module_get_module(itr);