由于create_proc_entry功能已被弃用,它的替代品是什么?我试图创建一个简单的proc条目,create_proc_entry但得到了这个错误:
错误:函数'create_proc_entry'的隐式声明
我create_proc_entry在proc_fs.h中抓了一下但是没找到它.有什么东西我缺少或有替代方法吗?
我是Linux内核模块编程的新手.从我到目前为止阅读的材料中,我发现用户程序有3种方式来请求服务或与Linux内核模块通信
问题:我们还有哪些其他选项可用于用户程序和Linux内核模块之间的通信?
我正在尝试将内容加载到我的内核中,以了解如何添加内容!
我这里有两个文件!
下面是skynet.c:
#include <linux/module.h> // included for all kernel modules
#include <linux/kernel.h> // included for KERN_INFO
#include <linux/init.h> // included for __init and __exit macros
#include <linux/proc_fs.h> // file operations
#include <linux/seq_file.h> // seq_read, ...
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Dr. Dyson");
MODULE_DESCRIPTION("Global Information Grid");
static int skynet_show(struct seq_file *m, void *v);
static int skynet_open(struct inode *inode, struct file *file);
static const struct file_operations skynet_fops = {
.owner = THIS_MODULE,
.open = skynet_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
}; …Run Code Online (Sandbox Code Playgroud)