Passing argument 4 of ‘proc_create’ from incompatible pointer type [closed]

喜你入骨 提交于 2020-12-10 16:31:27

问题


I'm trying to make a simple procfs module, but I get this error:

error: passing argument 4 of ‘proc_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]

I tried many online examples and i got same error message.


回答1:


You have to use proc_ops in newer kernels instead of file_operations, see https://lore.kernel.org/linux-fsdevel/20191225172228.GA13378@avx2/:

static struct proc_ops my_fops={
    .proc_open = my_proc_open,
    .proc_release = single_release,
    .proc_read = seq_read,
    .proc_lseek = seq_lseek,
    .proc_write = my_proc_write
};


来源:https://stackoverflow.com/questions/61295277/passing-argument-4-of-proc-create-from-incompatible-pointer-type

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!