错误:函数“create_proc_entry”的隐式声明

Dpk*_*Dpk 3 linux kernel linux-device-driver

内核版本:3.13.0-32-generic

\n\n

当我构建模块时出现错误

\n\n
\n

make -C /lib/modules/3.13.0-32-generic/build\n M=/home/wipro/Downloads/proc 模块 make[1]: 进入目录\n /usr/src/linux-headers-3.13.0-32-generic\' CC [M] \n /home/wipro/Downloads/proc/proc.o /home/wipro/Downloads/proc/proc.c:\n In function \xe2\x80\x98proc_win_init\xe2\x80\x99: /home/wipro/Downloads/proc/proc.c:21:5:\n error: implicit declaration of function \xe2\x80\x98create_proc_entry\xe2\x80\x99\n [-Werror=implicit-function-declaration]\n if ((file = create_proc_entry("rel_time", 0666, parent)) == NULL) {\n ^ /home/wipro/Downloads/proc/proc.c:21:15: warning: assignment makes pointer from integer without a cast [enabled by default]\n if ((file = create_proc_entry("rel_time", 0666, parent)) == NULL) {\n ^ /home/wipro/Downloads/proc/proc.c:25:9: error: dereferencing pointer to incomplete type\n file->read_proc = time_read;\n ^ /home/wipro/Downloads/proc/proc.c:26:9: error: dereferencing pointer to incomplete type\n file->write_proc = time_write;\n ^ /home/wipro/Downloads/proc/proc.c:32:9: error: dereferencing pointer to incomplete type\n link->uid = 0;\n ^ /home/wipro/Downloads/proc/proc.c:33:9: error: dereferencing pointer to incomplete type\n link->gid = 100;\n ^ cc1: some warnings being treated as errors make[2]: *** [/home/wipro/Downloads/proc/proc.o] Error 1 make[1]: ***\n [_module_/home/wipro/Downloads/proc] Error 2 make[1]: Leaving\n directory /usr/src/linux-headers-3.13。 0-32-generic\' make: ***\n [默认] 错误 2

\n
\n\n

如何消除错误

\n

Tsy*_*rev 5

create_proc_entry自 3.10 内核版本以来已被删除。替代方法是使用proc_create. 请参阅该问题以获取更多信息。