Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linux-kernel

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.

like image 379
smalinux Avatar asked Sep 05 '25 05:09

smalinux


1 Answers

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
};
like image 168
Arkadiusz Drabczyk Avatar answered Sep 07 '25 21:09

Arkadiusz Drabczyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!