PacktPublishing / Extreme-C

Extreme C, published by Packt
MIT License
318 stars 132 forks source link

Chapter 11 Kernel module #5

Open pararti opened 2 years ago

pararti commented 2 years ago

My linux kernel version 5.18.14-arch1-1 and hwkm.c don't work. I have a next error - error: in passing argument 4 "proc_create": incompatible pointer type [-Werror=incompatible-pointer-types]

proc_file = proc_create("hwkm", 0, NULL, &proc_file_fops); ^~~~~~~
const struct file_operations *

I know that in kernel 5.6 and more its done differently but i don't know how...

pararti commented 2 years ago

I am sorry for my bad english and this is my first issue:)

CharlzKlug commented 1 year ago

My linux kernel version 5.18.14-arch1-1 and hwkm.c don't work.

In the kernel 5.18.14 uses const struct proc_ops *proc_ops, not const struct file_operations*. You should use const struct proc_ops *proc_ops