linux – 隱式宣告函式’create_proc_entry’
我試圖使用create_proc_entry()函式在/ proc下建立一個目錄.當我嘗試編譯程式碼時,我得到以下錯誤:隱式宣告函式’create_proc_entry’.
這些是我的.c檔案中包含的標題:
#include <linux/module.h> #include <linux/kernel.h> #include <linux/proc_fs.h> #include <linux/string.h> #include <linux/vmalloc.h> #include <linux/uaccess.h>
我正在編譯的機器上的核心版本是:3.10.33-g7954807-dirty
我是否缺少呼叫此方法所需的標頭檔案?還是在我的核心版本中不推薦使用的方法?
3.10版本:
ofollow,noindex" target="_blank">http://lxr.free-electrons.com/source/include/linux/proc_fs.h?v=3.10您可以在“Linux裝置驅動程式4”一書中找到更多關於使用全功能/ proc功能的解釋,或者,如果您想要更短的解決方案,請檢視此連結(https://github.com/jesstess/ldd4/blob/master/scull/main.c ),瞭解如何使用struct file_operations.您不必設定到結構體的所有欄位.
http://stackoverflow.com/questions/26808325/implicit-declaration-of-function-create-proc-entry