LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Read file in kernel space (https://www.linuxquestions.org/questions/programming-9/read-file-in-kernel-space-476120/)

aluser 08-22-2006 01:17 AM

Read file in kernel space
 
I want to write some kernel code that reads and writes files, but I'm a bit stumped because vfs_read() and vfs_write() take pointers to userspace buffers. I assume that, if I just pass a kmalloc'd one, the filesystem code will call access_ok() or similar and choke.

So, how can I avoid this *OR* how do I temporarily allocate a userspace buffer that I can pass to vfs_read() and vfs_write()?

thanks

__J 08-22-2006 04:51 AM

http://www.linuxjournal.com/article/8110

try this, I read this a while ago and it seems to be what you want.

HTH.

aluser 08-22-2006 09:28 AM

fantastic. Thanks a lot.


All times are GMT -5. The time now is 12:02 AM.