• Home
Name Date Size #Lines LOC

..--

docs/03-May-2024-187152

python/03-May-2024-662526

.gitignoreD03-May-202445 76

COPYINGD03-May-202425.8 KiB505418

MakefileD03-May-2024332 145

READMED03-May-20241.3 KiB5942

libkmod-builtin.cD03-May-20246.2 KiB331237

libkmod-config.cD03-May-202427.8 KiB1,196835

libkmod-elf.cD03-May-202427.9 KiB1,215988

libkmod-file.cD03-May-202410.5 KiB524435

libkmod-index.cD03-May-202423.1 KiB1,083738

libkmod-index.hD03-May-20241.7 KiB4922

libkmod-internal.hD03-May-202410.4 KiB206162

libkmod-list.cD03-May-20246.8 KiB315186

libkmod-module.cD03-May-202470.5 KiB2,9291,768

libkmod-signature.cD03-May-20248.3 KiB364272

libkmod.cD03-May-202422.7 KiB980625

libkmod.hD03-May-20249.2 KiB266172

libkmod.pc.inD03-May-2024270 1210

libkmod.symD03-May-20242 KiB9483

README

1libkmod - linux kernel module handling library
2
3ABSTRACT
4========
5
6libkmod was created to allow programs to easily insert, remove and
7list modules, also checking its properties, dependencies and aliases.
8
9there is no shared/global context information and it can be used by
10multiple sites on a single program, also being able to be used from
11threads, although it's not thread safe (you must lock explicitly).
12
13
14OVERVIEW
15========
16
17Every user should create and manage it's own library context with:
18
19   struct kmod_ctx *ctx = kmod_new(kernel_dirname);
20   kmod_unref(ctx);
21
22
23Modules can be created by various means:
24
25   struct kmod_module *mod;
26   int err;
27
28   err = kmod_module_new_from_path(ctx, path, &mod);
29   if (err < 0) {
30      /* code */
31   } else {
32      /* code */
33      kmod_module_unref(mod);
34   }
35
36   err = kmod_module_new_from_name(ctx, name, &mod);
37   if (err < 0) {
38      /* code */
39   } else {
40      /* code */
41      kmod_module_unref(mod);
42   }
43
44
45Or could be resolved from a known alias to a list of alternatives:
46
47   struct kmod_list *list, *itr;
48   int err;
49   err = kmod_module_new_from_lookup(ctx, alias, &list);
50   if (err < 0) {
51      /* code */
52   } else {
53      kmod_list_foreach(itr, list) {
54         struct kmod_module *mod = kmod_module_get_module(itr);
55         /* code */
56      }
57   }
58
59