我写了一个简单的 jiffies 代码,当我尝试做 rmmod 我得到
ERROR: Removing 'jiffi_module': Device or resource busy
所以我做了一些研究,发现通过在“永久”症状下执行 lsmod 是由未找到 exit_function 引起的问题。
Module Size Used by
jiffi_module 1027 0 **[permanent]**
事实上,我的 make 文件确实向我显示了与退出功能相关的警告
退出函数定义为时的警告
static void __exit
jif_exit(void)
{
remove_proc_entry("jif", NULL);
}
warning: data definition has no type or storage class
warning: type defaults to ‘int’ in declaration of ‘modile_exit’
warning: parameter names (without types) in function declaration
warning: ‘jif_exit’ defined but not used
当我删除 __exit 似乎它至少识别 jif_exit - 所以现在我得到的警告是
warning: data definition has no type or storage class
warning: type defaults to ‘int’ in declaration of ‘modile_exit’
warning: parameter names (without types) in function declaration
它谈到 gcc 不匹配是一个问题?有人可以帮助我无法进一步调试吗?任何指针如何正确加载模块使其不是永久性的?