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.
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
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With