Top | ![]() |
![]() |
![]() |
![]() |
int | kmod_module_new_from_loaded () |
int | kmod_module_get_initstate () |
const char * | kmod_module_initstate_str () |
long | kmod_module_get_size () |
int | kmod_module_get_refcnt () |
struct kmod_list * | kmod_module_get_holders () |
Information about currently loaded modules, as reported by Linux kernel. These information are not cached by libkmod and are always read from /sys and /proc/modules.
int kmod_module_new_from_loaded (struct kmod_ctx *ctx
,struct kmod_list **list
);
Create a new list of kmod modules with all modules currently loaded in
kernel. It uses /proc/modules to get the names of loaded modules and to
create kmod modules by calling kmod_module_new_from_name()
in each of them.
They are put in list
in no particular order.
The initial refcount is 1, and needs to be decremented to release the
resources of the kmod_module. The returned list
must be released by
calling kmod_module_unref_list()
. Since libkmod keeps track of all
kmod_modules created, they are all released upon ctx
destruction too. Do
not unref ctx
before all the desired operations with the returned list are
completed.
int
kmod_module_get_initstate (const struct kmod_module *mod
);
Get the initstate of this mod
, as returned by Linux Kernel, by reading
/sys filesystem.
const char *
kmod_module_initstate_str (enum kmod_module_initstate state
);
Translate a initstate to a string.
long
kmod_module_get_size (const struct kmod_module *mod
);
Get the size of this kmod module as returned by Linux kernel. If supported, the size is read from the coresize attribute in /sys/module. For older kernels, this falls back on /proc/modules and searches for the specified module to get its size.
int
kmod_module_get_refcnt (const struct kmod_module *mod
);
Get the ref count of this mod
, as returned by Linux Kernel, by reading
/sys filesystem.
struct kmod_list *
kmod_module_get_holders (const struct kmod_module *mod
);
Get a list of kmod modules that are holding this mod
, as returned by Linux
Kernel. After use, free the list
by calling kmod_module_unref_list()
.