Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-22-2006, 01:17 AM   #1
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 42
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()?

Old 08-22-2006, 04:51 AM   #2
Senior Member
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46

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

Old 08-22-2006, 09:28 AM   #3
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Original Poster
Rep: Reputation: 42
fantastic. Thanks a lot.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
notify user space application from the kernel space lordofring Linux - Software 2 06-22-2009 12:32 PM
creation of new file in kernel space vishalbutte Programming 3 03-14-2006 02:32 AM
Accessing file in kernel space manali Programming 1 02-28-2006 05:03 PM
read file from running kernel b123coder Programming 1 11-18-2004 04:05 AM
How can I read regular file in kernel module jooboo Programming 5 12-30-2003 07:11 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration