gpt4 book ai didi

c - 无法 insmod 或使用内核间模块

转载 作者:行者123 更新时间:2023-12-01 12:44:15 24 4
gpt4 key购买 nike

我在内核驱动程序 1 (KD1.ko) 中有一个函数:

static void test (void);
EXPORT_SYMBOL(test);

static void test() {
printk("<<< MISSION DONE >>>.\n");
}

在内核驱动程序 2 (KD2.ko) 中:

extern static void test (void);

我试着这样调用它。

我设法 insmod KD1.ko,但我无法 insmod KD2.ko。我错过了什么吗?

最佳答案

test()static

所以你不能导出静态函数。

http://osdir.com/ml/linux.kernel.kernelnewbies/2003-02/msg00149.html

关于c - 无法 insmod 或使用内核间模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21746378/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com