kernelHow to read/write files within kernel module?
Posted
by Methos
on Stack Overflow
See other posts from Stack Overflow
or by Methos
Published on 2009-07-26T10:59:12Z
Indexed on
2010/04/23
20:53 UTC
Read the original article
Hit count: 451
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?
© Stack Overflow or respective owner