kernelHow to read/write files within kernel module?
- by Methos
I know all the discussions about why one should not read/write files from kernel, instead how to use /proc or netlink to do that. I want to read/write anyway. I have also read
http://www.linuxjournal.com/article/8110
However, problem is 2.6.30 does not export sys_read(). Rather its wrapped in SYSCALL_DEFINE3. So if I use that in my module, I get following warnings:
WARNING: "sys_read" [xxx.ko] undefined!
WARNING: "sys_open" [xxx.ko] undefined!
Obviously insmod cannot load the module because linking does not happen correctly.
Questions:
How to read/write within kernel after 2.6.22 (where sys_read()/sys_open() are not exported)?
In general, how to use system calls wrapped in macro SYSCALL_DEFINEn() from within the kernel?