gpt4 book ai didi

c - 从内核读取 seq_file

转载 作者:太空宇宙 更新时间:2023-11-04 02:59:51 25 4
gpt4 key购买 nike

您能否发布一些示例如何从 /proc 文件中读取含义列表?

list_head* get_from_proc_file()
{
struct file* file = fopen("example","r");
seq_open(file, &seq_ops);
struct seq_file *p = file->private_data;
READ LIST OF DATA?????
}

最佳答案

您不能使用 fopen 因为这是一个 libc 函数。下面的示例显示了如何从内核读取文件。

http://www.wasm.ru/forum/viewtopic.php?pid=467952#p467952

关于c - 从内核读取 seq_file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13329724/

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