|
libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
An example loadable kernel module (LKM) that can display a message in the /var/log/[kern.log|messages] file when the module is loaded and removed. The module can accept an argument when it is loaded – the name, which appears in the kernel log files. More...
Go to the source code of this file.
Functions | |
| MODULE_LICENSE (LIBJMMCG_MODULE_LICENSE) | |
| The license type – this affects runtime behavior. More... | |
| MODULE_AUTHOR (LIBJMMCG_MODULE_AUTHOR) | |
| The author – visible when you use modinfo. More... | |
| MODULE_DESCRIPTION (LIBJMMCG_MODULE_DESCRIPTION) | |
| The description – see modinfo. More... | |
| MODULE_VERSION (LIBJMMCG_MODULE_VERSION) | |
| The version of the module. More... | |
| module_param (name, charp, S_IRUGO) | |
| Param desc. charp = char ptr, S_IRUGO can be read/not changed. More... | |
| MODULE_PARM_DESC (name, "The module name to display in /var/log/kern.log") | |
| Parameter description. More... | |
| module_init (init_the_module) | |
| A module must use the module_init() module_exit() macros from linux/init.h, which identify the initialization function at insertion time and the cleanup function (as listed above). More... | |
| module_exit (exit_the_module) | |
An example loadable kernel module (LKM) that can display a message in the /var/log/[kern.log|messages] file when the module is loaded and removed. The module can accept an argument when it is loaded – the name, which appears in the kernel log files.
Details for how to create this came from:
Definition in file ioctl_example.c.
| MODULE_AUTHOR | ( | LIBJMMCG_MODULE_AUTHOR | ) |
The author – visible when you use modinfo.
| MODULE_DESCRIPTION | ( | LIBJMMCG_MODULE_DESCRIPTION | ) |
The description – see modinfo.
| module_exit | ( | exit_the_module | ) |
| module_init | ( | init_the_module | ) |
A module must use the module_init() module_exit() macros from linux/init.h, which identify the initialization function at insertion time and the cleanup function (as listed above).
| MODULE_LICENSE | ( | LIBJMMCG_MODULE_LICENSE | ) |
The license type – this affects runtime behavior.
| module_param | ( | name | , |
| charp | , | ||
| S_IRUGO | |||
| ) |
Param desc. charp = char ptr, S_IRUGO can be read/not changed.
| MODULE_PARM_DESC | ( | name | , |
| "The module name to display in /var/log/kern.log" | |||
| ) |
Parameter description.
| MODULE_VERSION | ( | LIBJMMCG_MODULE_VERSION | ) |
The version of the module.