中缺少 Ubuntu proc_root_driver

发布于 2024-10-02 05:38:31 字数 168 浏览 2 评论 0 原文

我正在尝试使用内核 2.6.35-22 在 Ubuntu 10.04 中编译内核模块,但它抱怨 proc_root_driver 丢失。我做了一些搜索,发现应该定义它,但在我的 linux-headers 版本中,它没有定义。是否有另一个全局变量我应该在其位置使用,或者是否有一种方法可以在某处定义它以便内核模块可以编译?

I am trying to compile a kernel module in Ubuntu 10.04 with kernel 2.6.35-22 and it is complaining about proc_root_driver missing. I did some searching and I found that is supposed to define this but in my version of the linux-headers, it isn't defined. Is there another global variable I am supposed to use in its place or is there a way that I can define it somewhere so that the kernel module can compile?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

偷得浮生 2024-10-09 05:38:31

proc_root_driver 曾经是指向 proc_dir_entry 的指针,创建为 proc_mkdir("driver", NULL);。它于 2008 年 4 月在此提交中被删除:http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=928b4d8c8963e75bdb133f562b03b07f9aa4844a

另外,我不我认为它应该是内核 API 的一部分,据我所知,它是一个内部的东西。

实际上,它并没有多大作用。您需要做的就是使用 /proc 下的完整路径,即

proc_array = proc_mkdir("drvnamehere", proc_root_driver);

用看起来像的代码替换看起来像的代码

proc_array = proc_mkdir("driver/drvnamehere", NULL);

,您应该没问题。

proc_root_driver used to be a pointer to a proc_dir_entry created as proc_mkdir("driver", NULL);. It was removed in April 2008 in this commit: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=928b4d8c8963e75bdb133f562b03b07f9aa4844a

Also, I don't think it was ever supposed to be part of the kernel API, AFAIK it was an internal thing.

It doesn't do much, really. All you need to do is use the full path under /proc, i.e. replace code that looks like

proc_array = proc_mkdir("drvnamehere", proc_root_driver);

with code that looks like

proc_array = proc_mkdir("driver/drvnamehere", NULL);

and you should be fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文