简体   繁体   中英

how use c dynamic library in linux kernel module

I have to add a plugin to a module that runs in linux at kernel level and I have to access to an extern library that can be changed regularly without being able to stop the execution of this Module

at userspace level , I know that we can use the dynamic library to make this kind of stuff . And my question is : Can we use this type of library at kernel level , otherwise is there an equivalent of userspace level dynamic library for kernel

You can't use a regular dynamic library in the kernel. However, kernel modules can be loaded and unloaded at runtime. So if you split your kernel code into long-running and dynamically reloadable parts, and link them into two separate kernel modules, you can achieve the same effect. Of course, your long-running kmod must not depend on the short-lived one; instead, you'll need the long running one to provide an interface that the reloadable module uses to register itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM