Home | History | Annotate | only in /external/kmod/libkmod
Up to higher level directory
NameDateSize
COPYING21-Aug-201825.8K
docs/21-Aug-2018
libkmod-config.c21-Aug-201827.8K
libkmod-elf.c21-Aug-201827.1K
libkmod-file.c21-Aug-20187.6K
libkmod-index.c21-Aug-201822.9K
libkmod-index.h21-Aug-20181.7K
libkmod-internal.h21-Aug-20189.4K
libkmod-list.c21-Aug-20186.8K
libkmod-module.c21-Aug-201868.2K
libkmod-signature.c21-Aug-20184.1K
libkmod.c21-Aug-201822K
libkmod.h21-Aug-20189.2K
libkmod.pc.in21-Aug-2018255
libkmod.sym21-Aug-20182K
Makefile21-Aug-2018332
python/21-Aug-2018
README21-Aug-20181.3K

README

      1 libkmod - linux kernel module handling library
      2 
      3 ABSTRACT
      4 ========
      5 
      6 libkmod was created to allow programs to easily insert, remove and
      7 list modules, also checking its properties, dependencies and aliases.
      8 
      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).
     12 
     13 
     14 OVERVIEW
     15 ========
     16 
     17 Every 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 
     23 Modules 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 
     45 Or 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